Methods in HashSet
- 10th Sep 2018
- 0
- 5570
- Different Methods in HashSet explain hashset with methods in java what are the methods defined in Hashset java
There are different methods defined in HashSet to perform various operations 1) boolean add(Object obj) 2) void clear() 3) Object clone() 4) boolean contains(Object obj) 5) boolean isEmpty() 6) boolean remove(Object obj) Let’s discuss each of these methods in detail boolean add(Object obj) It adds the element obj to the Set. Example : HashSet<String> hs […]