Which of the following statements are true about the default implementation of the public int hashCode() method of the Object class?

  1. The Object class does not provide any implementation for the hashCode method; every class must override it

  2. As far as it may be practically possible, the hashCode method defined by the Object class does return distinct integers for distinct objects

  3. For two object references referring to the same object, the hashCode method returns the same integer

  4. It returns a fixed number that internally represents the Object class for the JVM

  5. Only choice D is correct


Correct Option: B

Find more quizzes: