sortに渡すComparatorのbaseになる考え方
returnが1以上になるとsortはひっくり返す
public class Outer {
public static void main(String[] args) {
String s1 = new String("A");
String s2 = new String("B");
System.out.println(s1.compareTo(s2));
System.out.println(s1.compareTo(s1));
System.out.println(s2.compareTo(s1));
}
}
-1
0
1