//import java.util.*;
class MapTest6
{
public static void main(String[] args)
{
demo();
}
public static void demo()
{
HashMap<String,List<Student>> xuexiao=new HashMap<String,List<Student>>();
List banji1=new ArrayList<Student>();
List banji2=new ArrayList<Student>();
banji1.add(new Student("01","张三"));//这里怎么又问题了那
banji1.add(new Student("02","李四"));
banji2.add(new Student("01","王五"));
banji2.add(new Student("02","赵六"));
Set<String>keySet=xuexiao.keySet();
Iterator<String> it=keySet.iterator();
while (it.hasNext())
{
String banName=it.next();
List<Student> value=xuexiao.get(banName);
System.out.println(banName);
getInfos(value);
}
}
public static void getInfos(List<Student> value)
{
Iterator<Student>it=value.iterator();
while (it.hasNext())
{
Student s=it.next();
System.out.println(s);
}
}
}
错误
符号: 构造函数 Student(java.lang.String,java.lang.String)
位置: 类 Student
banji1.add(new Student("01","张三"));
^
MapTest5.java:73: 找不到符号
符号: 构造函数 Student(java.lang.String,java.lang.String)
位置: 类 Student
banji1.add(new Student("02","李四"));
^
MapTest5.java:74: 找不到符号
符号: 构造函数 Student(java.lang.String,java.lang.String)
位置: 类 Student
banji2.add(new Student("01","王五"));
^
MapTest5.java:75: 找不到符号
符号: 构造函数 Student(java.lang.String,java.lang.String)
位置: 类 Student
banji2.add(new Student("02","赵六"));
^
4 错误 |