https://github.com/pconrad/java-comparators
Given any type T
that implements Comparable<T>
, for example:
Integer
implementsComparable<Integer>
String
implementsComparable<String>
If we have an ArrayList<T> myList
, we can use:
Collections.sort(myList)
to sort that list.