java面试题之hashcode相等两个类一定相等吗?equals呢?相反呢?

答:hashcode相等,两个类不一定相等,equals也不一定相等;

反过来,equals相等,hashcode一定相等

posted @ 2018-11-19 14:17  胡金水  阅读(2703)  评论(0编辑  收藏  举报