August 31, 2014
I always forget how to write a comparator in Java, so here's an explanation for me to refer to.
You can sort a collection in Java using
Collections.sort(), passing in the collection and a Comparator:
List<Person> lPeopleList = new ArrayList<Person>(); lPeopleList.add(new Person("Stephen", 20)); lPeopleList ...