mapList.put(input,new Course(input,n1)); 为何无法赋值
int i = 0;
while(i<3){
System.out.println("请输入ID");
Integer input = Input.nextInt();
Course m1 = mapList.get(Input);
//System.out.println(m1); //这里m1为null
if(m1==null){
System.out.println("请输入姓名");
String n1 = Input.next();
mapList.put(input,new Course(input,n1));
//System.out.println(m1); //这里m1依旧为null
i++;
}
else{
System.out.println("ID被占用");
continue;
}
直到循环结束后m1才有值 导致else没法执行。。怎么破