class Person implements Comparable{
String name;
Person(String name){
this.name = name;
}
public int compareTo(Object obj){
String s = (String)obj;
return this.name.compareTo(s);//为什么这里虚拟机是调用String的compareTo方法,而不是递归此方法呢?
}
}
String的方法public int compareTo(String anotherString)
comparable的方法int compareTo(T o)