Relates :
|
|
Relates :
|
Interfaces Comparable and Comparator have similar methods compareTo(T o) and compare(T o1, T o2). The spec for method compareTo says that compareTo(null) should throw NPE, but is unclear how should behave method compare(...) while one or both or arguments is null. Even if the method compare(...) should not throw NPE, its behaviour in this case should be mentioned in the spec, because it is inconsistent with similar compareTo method.
|