Since I\'m just starting with JAVA, I\'m curious what is the best option for implementing sorting in JAVA (for ArrayLists). Below I provide my PHP code.
public i
for(int j = 0; j < myArray.size(); j++) {
for (int i = j+1 ; i < myArray.size(); i++){
if(myArray.get(i)[2].compareTo(myArray.get(j)[2]) < 0){
String[] temp = myArray.get(j);
myArray.set(j, myArray.get(i));
myArray.set(i, temp);
}
}
}
I'm using the third field (myArray.get(j)[2])
for comparing.
I hope this will help someone.