public static void main(String[] args) {

// 중복되는 원소가 있느냐의 여부와는 관계없이 리스트를 정렬하는 용도의 반복자

Comparator<Integer> naturalOrder = new Comparator<Integer>() {

public int compare(Integer first, Integer second) {

return first < second ? -1 : (first == second ? 0 : 1);

}

};


System.out.println(naturalOrder.compare(new Integer(30), new Integer(30)));

}


문제. 위 코드에서 콘솔에 출력되는 값과 그 이유는?