Do we have get(Object o) method in HashSet.
(a) True
(b) False
The 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
(a) True
(b) False
The 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
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.