这程序没有任何问题,CorrectHashCode是从Object继承过来,可以override hashCode() method
只是你的return 有问题,拼写错误
the correct code is :   return i*number;

解决方案 »

  1.   

    hahaha,平写问题,给分吧。这是大问题,不易发现的
      

  2.   

    public class CorrectHashCode
    {
    private int number;
    public CorrectHashCode(int i)
    {
    number=i;
    }

    public int hashCode()
    {
    int i=(int)(Math.random()*100);
    return i*number;//以该过
    }
    //other methods
    }答案:the code does not implement hashCode() method correctly对不起是我笔误,但改过来以后还是有错,这是一道scjp的考题
    我不是很明白