Comparable 인터페이스는 비교를 위한 인터페이스이다. 객체 정렬에 사용되는 compareTo 메소드를 선언하고 있고, 이 메소드를 재정의(Override)하여 boolean을 제외한 클래스의 인스턴스를 정렬할 수 있다. 부등호를 통해 쉽게 비교할 수 있는 int, string 등의 자료형과 달리 비교해야 하는 대상이 객체라면? x, y 좌표를 가진 객체의 배열을 정렬하는 경우를 생각해 보자. class Point{ public int x, y; Point(int x, int y){ this.x = x; this.y = y; } public class Main{ public static void main(String[] args){ ArrayList arr = new ArrayList(); arr...