Employee e = new Employee();
String eno=e.getEno();
HashMap<String,ArrayList<Employee>> map = new HashMap<String,ArrayList<Employee>>();
ArrayList<Employee> al = new ArrayList<Employee>();
Employee e1=new Employee("1001","Rahul", "Gupta", "agupta");
Employee e2=new Employee("1002","Bijay", "Gupta", "bjay");
al.add(e1);
al.add(e2);
map.put(eno, al);
for (Map.Entry<String, ArrayList<Employee>> entry : map.entrySet()) {
String key = entry.getKey();
ArrayList<Employee> values = entry.getValue();
System.out.println("Key = " + key);
System.out.println("Values = " + values + "n");
}
我得到鑰匙空,而我想打印 Eno.as鍵和值ENO,FNAME,LNAME和EMAILID要打印一個HashMap,其中關鍵是員工數量和價值的ArrayList
請自行研究一下!把你的努力放在它最基本的任務上! –