new一個集合
//Set是抽象類不能直接實例化
Set<String> a=new TreeSet<>();//a是一個有序的集合
Set<String> b=new HashSet<>();//b是一個無序的集合
//往集合裏添加元素
a.add("hello");
//對集合進行刪除元素
a.remove("hello");
//查詢集合大小
a.size();
//判斷集合是否包含某個元素
a.contains("hello");
//遍歷集合
Iterator it=a.iterator();
while(it.hasNext()) {
System.out.println(it.next());
}