package TT
import java.util.ArrayList
import java.util.HashMap
import java.util.HashSet
import java.util.LinkedList
import java.util.List
import java.util.Map
import java.util.Set
public class TEST {
public static void main(String[] args) {
// 作业内容1
ArrayList<Integer> aList = new ArrayList<Integer>()
for (int i = 1
if (i == 10) {
continue
}
aList.add(i)
}
for (int i = 0
System.out.println(aList.get(i))
}
// 作业内容2
List<String> llist = new LinkedList<String>()
llist.add("A")
llist.add("a")
llist.add("c")
llist.add("C")
llist.add("a")
String c=llist.size()==5?"List添加成功":"List添加失败"
System.out.println(c)
Set<String> set = new HashSet<String>()
set.add("A")
set.add("a")
set.add("c")
set.add("C")
set.add("a")
String c1=set.size()==5?"set添加成功":"set添加失败"
System.out.println(c1)
// 作业内容3
Emp emp=new Emp("01")
Emp emp1=new Emp("015")
Map<String, String> map = new HashMap<String, String>()
map.put(emp.getID(), "你")
map.put(emp1.getID(), "我")
Set<String> Set=map.keySet()
for (String string : Set) {
System.out.println("删除015之前"+string)
}
Set.remove("015")
for (String string : Set) {
System.out.println("删除015之后"+string)
}
}
}
package TT;
public class Emp {
private String ID;
public Emp(String ID){
setID(ID);
}
public String getID() {
return ID;
}
public void setID(String iD) {
ID = iD;
}
}