Question: What is a valid use of the hashCode() method?

  1. encrypting user passwords
  2. deciding if two instances of a class are equal
  3. enabling HashMap to find matches faster
  4. moving objects from a List to a HashMap

Answer: The correct answer of the above question is Option B:deciding if two instances of a class are equal