解决方案 »

  1.   

    点击hashCode()方法调用的还是HashSet里面的hashcode算法。我重写的似乎没有覆盖。
      

  2.   


    点击hashCode()方法调用的还是HashSet里面的hashcode算法。我重写的似乎没有覆盖。
      

  3.   

    你写的hashcode方法是在放入hashset或者hashmap时调用的!你那条输出语句明明就是叫用hashset自身的方法,和你重新的没关系吧!
      

  4.   

    MapDemo mapDemo = new MapDemo();
    mapDemo.hashCode();