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