Solved

You Intend to Use a Hash Set with Your Own

Question 73

Multiple Choice

You intend to use a hash set with your own object class.Which of the following statements is correct?


A) You cannot override the hashCode method in the Object class.
B) You can use the hash method of the Objects class to create your own hashCode method by combining the hash codes for the instance variables.
C) You can override the hash method for your class provided that it is compatible with its equals method.
D) Your class's hashCode method does not need to be compatible with its equals method.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents