diff --git a/src/main/java/com/github/hcsp/polymorphism/User.java b/src/main/java/com/github/hcsp/polymorphism/User.java index 7a601df..cf3195d 100644 --- a/src/main/java/com/github/hcsp/polymorphism/User.java +++ b/src/main/java/com/github/hcsp/polymorphism/User.java @@ -47,7 +47,16 @@ public int hashCode() { /** 老板说让我按照用户名排序 */ @Override public int compareTo(User o) { - return name.compareTo(o.name); + if(name.charAt(0)o.name.charAt(0)){ + return 1; + } + if(this.getId()