Comparable 썸네일형 리스트형 Comparable 구현하여 사용자객체 정렬하기 public class UserObject implements Comparable { private int priority; public UserObject(int priority) { this.priority = priority; } public int compareTo(UserObject o) { if(this.priority o.priority) { return 1; } else { return 0; } } public String toString() { return "priority : " + this.priority; } } public class CompareTest { public static v.. 더보기 이전 1 다음