How to get keys from a hashmap in java? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to get keys from a hashmap in java?

I have a hashmap with a number of values.I want to get the key from map using its value.

22nd Aug 2019, 5:12 PM
_rk
_rk - avatar
1 Answer
+ 8
There exists a method keySet() which returns a set of the keys. https://code.sololearn.com/c7BrlKiE1Uxp/?ref=app
22nd Aug 2019, 5:29 PM
Denise Roßberg
Denise Roßberg - avatar