1.

Do we have get(Object o) method in HashSet.(a) True(b) FalseThe question was posed to me by my school teacher while I was bunking the class.Query is from Data Structures-Set in portion java.util – The Collections Framework of Java

Answer»

Correct CHOICE is (b) False

To explain: get(Object o) METHOD is useful when we want to compare objects based on the comparison of values. HASHSET does not provide any way to compare objects. It just guarantees UNIQUE objects STORED in the collection.



Discussion

No Comment Found

Related InterviewSolutions