Skip to main content

Comparable vs Comparator

Learn Comparable vs Comparator (Advanced Java Concepts, Java) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

1. Introduction Comparable gives a class its natural order with compareTo , while Comparator defines other orders externally with compare.

More lessons in Advanced Java Concepts