Though there is no sorted list in Java there is however a sorted queue which would probably work just as well for you. It is the java. util. PriorityQueue class.
Which collection is sorted in Java?
A SortedSet is a Set that maintains its elements in ascending order, sorted according to the elements' natural ordering or according to a Comparator provided at SortedSet creation time.
Is ArrayList sorted in Java?
Approach: An ArrayList can be Sorted by using the sort() method of the Collections Class in Java. This sort() method takes the collection to be sorted as the parameter and returns a Collection sorted in the Ascending Order by default.