在map中是否存在value值的問題
?if(students.containsValue(new Student(null,name)))
??? ???? System.out.println("在map表中存在:"+students.get(id).name);
為什么調用這個新的學生對象是用的是 ? student.get(id).name?????
這個新的學生對象的id不是為空嗎???? 怎么實現的調用????
?if(students.containsValue(new Student(null,name)))
??? ???? System.out.println("在map表中存在:"+students.get(id).name);
為什么調用這個新的學生對象是用的是 ? student.get(id).name?????
這個新的學生對象的id不是為空嗎???? 怎么實現的調用????
2018-11-01
舉報
2018-11-02
它調用的是students.get(id).name(students是map)
不是?student.get(id).name(這句是錯的,student是student對象)