Help with my sort program

Code:

` public void sortStudent(){`

String []temp = new String[getStudentLength()];

//data[i][1] holds the names of the students

for(int i = 0; data[i][1]!=null && i < getStudentLength(); i++){

temp[i] = data[i][1]+"";

}

Arrays.sort(temp);

//after sorting the single arrays I implemented it in 2d arrays but I am having trouble doing it

for(int x = 0; x<temp.length;x++){

for(int y =0; y<temp.length;y++){

if(temp[x].equalsIgnoreCase(data[y][1]+"")){

data[x] = data[y];

}

}

}

}

I need help on this sorting I don't really know how to sort 2d arrays