import java.util.*; public class LinkList { public static void main(String args[]){
Student s1=new Student("1","23"),
s2=new Student("32","22"),
s3=new Student("3","2323"),
s4=new Student("4","233");
HashMap<String,Student> table=new HashMap<String,Student>();
table.put(s1.core,s1);
table.put(s2.core,s2);
table.put(s3.core,s3);
table.put(s4.core,s4);
String key="1";
if(table.containsKey(key)){
System.out.println("ok");
System.out.println(table.get(key).name+"友好");
}
Collection<Student> colletion=table.values();
Iterator<Student> iter=colletion.iterator();
while(iter.hasNext()){
Student stu=iter.next();
System.out.println(stu.name+":"+stu.core);
}
} }