package javaapplication1;
import java.util.HashSet;
public class JavaApplication1 {
public static void main(String[] args) {
HashSet hash = new HashSet();
hash.add(new Integer("1"));
hash.add(new Integer("2"));
hash.add(new Integer("3"));
hash.add(new Integer("4"));
hash.add(new Integer("5"));
hash.add(new Integer("6"));
hash.add(new Integer("7"));
System.out.println("Size of HashSet: " + hash.size());
hash.remove(new Integer("2"));
System.out.println("Size of HashSet: " + hash.size());
}
}
/*
run:
Size of HashSet: 7
Size of HashSet: 6
*/