I have this 2 dimensional string array. 

```
2 10 BakerSarah D 
2 11 SmothersSally A 
2 12 SillySall C 
2 13 Viper B 
2 5 LouieChef B 
2 6 Lawson C  

```

Each column is string . Now I want to sort this on second column . i have tried this code 

```
void sortarray(final int index){
        Arrays.sort(data, new Comparator<Object[]>(){
            @Override
            public int compare(Object[] o1,  Object[] o2) {
                String[] a = (String[])o1;
                String[] b = (String[])o1;
                return a[index].compareTo(b[index]);
            }
        });

    }   

```

but this is giving sort in 

```
    2 10 BakerSarah D 
    2 11 SmothersSally A 
    2 12 SillySall C 
    2 13 Viper B 
    2 5 LouieChef B 
    2 6 Lawson C  

```

in order . Why so ?? 
How to change that to sort

```
2 5 LouieChef B 
2 6 Lawson C   
2 10 BakerSarah D 
2 11 SmothersSally A 
2 12 SillySall C 
2 13 Viper B 

```