CSC300: Natural Order [5/8] |
Natural order String
is dictionary order
String
implements java.lang.Comparable
public interface Comparable<T> { int compareTo(T that); }
this<that
this>that
this==that
External order specified by CardComparator
CardComparator
implements java.util.Comparator
public interface Comparator<T> { int compareTo(T o1, T o2); }
o1<o2
o1>o2
o1==o2