求解答 为什么输出不了名字
public void testPut() {
Scanner sc = new Scanner(System.in);
int i=0;
while(i<3) {
System.out.println("put id");
String ID = sc.next();
Student st = students.get(ID);
if(st==null)
{
System.out.println("put name");
String name = sc.next();
Student newStudent = new Student(ID,name);
students.put(ID, newStudent);
System.out.println("ok add"+students.get(ID).name);
i++;
}else {
System.out.println("get out");
}
}
}