Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要将元素添加到哈希表中,并且我的哈希表需要有一个数组列表。但我无法找到在表格中正确添加元素的方法。请帮帮我。
static Hashtable<Integer, ArrayList<Integer>> assignedLeader = new Hashtable<Integer, ArrayList<Integer>>(20);
仅供参考。
static Hashtable<Integer, ArrayList<Integer>> assignedLeader = new Hashtable<Integer, ArrayList<Integer>>(20); ArrayList<Integer> al=new ArrayList<Integer>(); al.add(1); al.add(2); al.add(3); assignedLeader.put(1, al);