更新时间:2023-12-06 14:04:16
如果我理解正确,不难。
Not difficult if I understand correctly.
Map<String, Set<Integer>> reqdMap = new HashMap<String, Set<Integer>>();
//Form the set corresponding to apple.
Set<Integer> appleSet = new HashSet<Integer>();
appleSet.add(1);
...
reqdMap.put("apple", appleSet);
//To Retrieve
appleSet = reqdMap.get("apple");