How can we use containsKey and containsValue méthodes? With a if condition? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How can we use containsKey and containsValue méthodes? With a if condition?

15th Jul 2016, 7:12 PM
arghlub
2 Answers
+ 2
just use map.containsKey(key) for key search and map.containsValue(value) for value search. Both are boolean type will return true if value is present and vice-versa.
15th Jul 2016, 8:11 PM
deepanshu7211
0
thanks ;-)
15th Jul 2016, 8:57 PM
arghlub