单选题Given: Which statement is true?()ACompilation fails because the hashCode method is not overridden.BA HashSet could contain multiple Person objects with the same name.CAll Person objects will have the same hash code because the hashCode method is not o

题目
单选题
Given: Which statement is true?()
A

Compilation fails because the hashCode method is not overridden.

B

A HashSet could contain multiple Person objects with the same name.

C

All Person objects will have the same hash code because the hashCode method is not overridden.

D

If a HashSet contains more than one Person object with name="Fred", then removing another Person,also with name="Fred", will remove them all.


相似考题