JAVA_List_and_Collecction_and_Comparable

1     public int compareTo(Object o) {
2         Name n = (Name)o;
3         int lastCmp =
4             lastName.compareTo(n.lastName);
5         return
6              (lastCmp!=0 ? lastCmp :
7               firstName.compareTo(n.firstName));
8     }

时间: 2024-11-10 00:34:10

JAVA_List_and_Collecction_and_Comparable的相关文章