you must override hashCode in every class that overrides equals,particularly HashMap,HashSet,Hashtable.
The key provision that is violated when you fail to override hashCode is the second one:equal objects must have equal hash codes.
hashCode 生成基本方法,但是其实一般实体都有主键的存在,对主键hashCode即可,也能满足上面的约束;
小技巧 hashCode的结果可以缓存起来,不需要每次都计算
String,Integer,Date这些类的hashCode 返回这个实例的值,这不是一个很好方法,有待改进加强.