Multiple choice

Which of following methods are present in the Collection Interface in Java?

  1. HashCode()

  2. HasNext()

  3. Next()

  4. AllRetain()

  5. EnsureCapacity()

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

This is the correct answer. Hashcode() method is present in the Collection Interface. This function returns the hashcode for the collection. The hashcode of two objects must be same if the two objects are equal. So this is the correct answer.