import java.util.Set;
import java.util.HashSet;
import java.util.Iterator;
public class Test {
public static void main(String args[]){
Set<String> set = new HashSet<String>();
//Set中的元素不能重复,重复会覆盖原有元素。
set.add("suyan");
set.add("zhangli");
set.add("suzihao");
set.add("suyuetong");
Iterator it = set.iterator();
while(it.hasNext()){
System.out.println(it.next());
}
int length = set.size();
System.out.println(length);
set.remove(0);
set.clear();
boolean b = set.isEmpty();
System.out.println(b);
}
}
/*
*output
*suyuetong
*suyan
*suzihao
*zhangli
*4
*true
* */