Mega Code Archive

 
Categories / Java Tutorial / Collections
 

Remove all elements from a set

import java.util.HashSet; import java.util.Set; public class Main {   public static void main(String[] argv) throws Exception {     Set set1 = new HashSet();     set1.clear();   } }