Introduction :
In Java, Comparable & Comparator are two interfaces used for sorting collections of objects. Both are helpful for sorting collections of objects of custom classes.
All wrapper classes by default implement Comparable, so we can directly...