日期:2014-05-20 浏览次数:20659 次
class User{ private int age; private String name; private String email; @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + age; result = prime * result + ((email == null) ? 0 : email.hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode()); return result; } }