/* from 时代Java - N o w J a v a . c o m*/
import java.util.HashSet;
public class Main {
public static void main(String[] args) {
HashSet hSet = new HashSet();
System.out.println("Size of HashSet : " + hSet.size());
//add elements to HashSet object
hSet.add(new Integer("1"));
hSet.add(new Integer("2"));
hSet.add(new Integer("3"));
System.out.println("Size of HashSet after addition : " + hSet.size());
//remove one element from HashSet using remove method
/**代码未完, 请加载全部代码(NowJava.com).**/
本文系作者在时代Java发表,未经许可,不得转载。如有侵权,请联系nowjava@qq.com删除。