Integer value set : HashSet « Collections Data Structure « Java
- Java
- Collections Data Structure
- HashSet
Integer value set
import java.util.HashSet;
public class Main {
public static void main(String[] args) {
HashSet<Integer> hSet = new HashSet<Integer>();
hSet.add(new Integer("1"));
hSet.add(new Integer("2"));
hSet.add(new Integer("3"));
System.out.println("HashSet contains.." + hSet);
}
}
//HashSet contains..[1, 2, 3]
Related examples in the same category