I am referencing my java version JDK 1.8 but I am still getting error. What is wrong with this referencing (writing Java after 6 years)? or any other simpler way to do this? I d
Alternatively anytime you need Comparator or any other class that implements Comparable you can call:
Comparator
class
Comparable
Comparator.naturalOrder()
https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html#naturalOrder--