Remove HashSet elements
- 10th Sep 2018
- 0
- 5009
- how to clear all elements in hashset java how to delete elements in hashset java how to remove all elements in hashset java how to remove elements in hashset java Remove HashSet elements
We can use remove() method of HashSet to remove elements from HashSet collection boolean remove(Object obj) Example import java.util.*; public class HashSetRemoveExample { public static void main(String args[]) { HashSet<String> hs = new HashSet<String>(); hs.add("java"); hs.add("c"); hs.add("c++"); […]