对象之间比较

重写equals方法和hashcode方法 public boolean equals(Object otherobj){ if(otherobj == null) return false; else{ if(otherobj instanceof User){ User user = (User) otherobj; if(user.id == id && name.equals(user.n
相关文章
相关标签/搜索