The Comparable Interface

The Comparable interface was added with JDK 1.2. This interface defines the compareTo() method. Objects of classes that implement the Comparable interface can be compared to each other and sorted.

Get Sun Certification Training Guide (310-025, 310-027): Java™ 2 Programmer and Developer Exams now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.