I have an arraylist of objects. Any Object contain 4 fields. one of these fields is integer.I want sort these arrylist base on integer field of objects.
I use this code bud i don't know how it must be to work correctly.
Collections.sort(list, new Comparator(){
public int compare(Object o1, Object o2) {
ob obs1 = (ob) o1;
ob obs2 = (ob) o2;
return ............);
}
});