The Java.util.EnumMap.containsValue(value) method in Java is used to determine whether one or more key of the map is associated with a given value or not. It takes the value as a parameter and returns True if that value is mapped by any of the keys in the EnumMap.
boolean containsValue(Object value)
Parameter: The method accepts one parameter value which refers to the value whose mapping is to be checked by any of the key.
Return Value: It returns true when one or more key is mapped to same value.
Below programs illustrate the containsValue() method:
Map contains 72: true
Map contains 2000: false
Attention reader! Don’t stop learning now. Get hold of all the important Java and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready.
- EnumMap remove() Method in Java
- EnumMap size() Method in Java
- EnumMap equals() Method in Java with Examples
- EnumMap clear() Method in Java with Examples
- EnumMap entrySet() Method in Java
- EnumMap clone() Method in Java
- EnumMap containsKey() Method in Java
- EnumMap values() Method in Java
- EnumMap put() Method in Java
- EnumMap putAll(map) Method in Java
- EnumMap keySet() Method in Java
- EnumMap get() Method in Java
- EnumMap class in Java
- Java.util.Collections.rotate() Method in Java with Examples
- Java.util.Collections.disjoint() Method in java with Examples
- Java.lang.string.replace() method in Java
- Java.util.ArrayList.add() Method in Java
- Java.util.ArrayList.addall() method in Java
- Java.util.BitSet.set() method in Java
- Java 8 | ArrayDeque removeIf() method in Java with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : nidhi_biet