Questions tagged [entryset]
32 questions
-1
votes
2 answers
Group Entries of a map into list
Let's suppose i have a HashMap with some entries:
Map hm= new HashMap();
hm.put(1,"ss");
hm.put(2,"ss");
hm.put(3,"bb");
hm.put(4,"cc");
hm.put(5,"ss");
i want output like:
[{1,ss},{2,ss},{5,ss}]
Is it possible?

Shruti Gusain
- 67
- 1
- 6
-1
votes
1 answer
Why does iterating over entry set not work?
I try to iterate over an EntrySet like this:
for (Entry> list : service.entrySet()) {
if (list.getKey() == typ1) {
for (B current : list.getValue()) {
…

Amanda123
- 25
- 4