Java examples for Collection Framework:HashSet
How to create Java HashSet and add value to HashSet
import java.util.HashSet; public class Main { public static void main(String[] args) { HashSet hSet = new HashSet(); //from w w w. ja v a2 s . c o m hSet.add(new Integer("1")); hSet.add(new Integer("2")); hSet.add(new Integer("3")); System.out.println("HashSet contains.." + hSet); } }