util.List publicclassList1 publicstaticvoidmain(Stringargs) Sorting Java Arraylists: one of the most important operation on ArrayList that you will most likely have to implement during enterprise application development. Often times, you may need to sort the ArrayList to make it alphabetically order. In this example, it shows the use of Collections. sort(List) to sort an ArrayList. The following situations may arise for converting List (ArrayList) to Set.3. to remove the duplicates of the ArrayList and sorts the contents of the Set. (convert ArrayList to TreeSet). In order to sort ArrayList by object properties, we will need to create a custom comparator which will compare objects based on their properties. Public constructors. ArrayList(int initialCapacity). Constructs an empty list with the specified initialSuch apps must not call sort(List) from this method.