多态引用中的Map接口
这是在多态引用中使用map接口的示例吗?
//some code here
Map<String, List<String>> adtDictionary;
//some code here
adtDictionary = new HashMap<String, List<String>>();
while (departmentScanner.hasNextLine()) {
String department = departmentScanner.nextLine().trim();
adtDictionary.put(department, new ArrayList<String>());
}
while (facultyScanner.hasNextLine()) {
String faculty = facultyScanner.nextLine();
String[] values = faculty.split(",");
adtDictionary.get(values[1].trim()).add(values[0]);
}
//some code here
暂无答案!
目前还没有任何答案,快来回答吧!