Set<Map.Entry<Student2, String>> set=hash.entrySet();
Iterator<Map.Entry<Student2, String>> it=set.iterator();
while(it.hasNext()){
Map.Entry<Student,String> me=it.next();
String add=me.getValue();
Student stu=me.getKey();
System.out.println(stu.getName()+"...."+stu.getAge()+"...."+add);
}
这里提示错误,怎么回事呢?
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Type mismatch: cannot convert from Map.Entry<Student2,String> to Map.Entry<Student,String> |