Tolgar
asked on
How to get the key of a value in a hashmap in Java?
How can I get the key of a value in a hashmap?
The reason, I am asking this is because I need to remove items from a hashmap but I can only know the value at the time I want to remove the key, value pair.
If I can get the key then i can use this key to remove the key,value pair from the hashmap.
How can I get the key then?
Thanks,
The reason, I am asking this is because I need to remove items from a hashmap but I can only know the value at the time I want to remove the key, value pair.
If I can get the key then i can use this key to remove the key,value pair from the hashmap.
How can I get the key then?
Thanks,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
@CEHJ: Can you please take a look at this related question:
https://www.experts-exchange.com/questions/28262749/How-to-remove-elements-from-a-hashmap-in-Java.html?anchorAnswerId=39564220#a39564220
Thanks,
https://www.experts-exchange.com/questions/28262749/How-to-remove-elements-from-a-hashmap-in-Java.html?anchorAnswerId=39564220#a39564220
Thanks,
You're using SWT are you not?
ASKER
Yes, I do.
I can't help i'm afraid. I don't do SWT
ASKER
ok. No problem.
mccarl is helping me now.
mccarl is helping me now.
ASKER
I cannot figure out why?