Suppose I have the following object class:
public class Country {
private int ID;
private String name;
private Double distance;
}
and I have a list of this object which contain many objects:
List<Country> myList;
how i can sort the list based on the Double distance
e.g to put objects with less distance first? Is there a ready function to do this?
Or i want to store 3 countries of minimum distances in another list.