Java EnumMap containsValue() methodThe containsValue() method of Java EnumMap class is used to check whether one or more key is associated with a given value or not. This method returns true if the specified value is mapped by any of the keys in the map. SyntaxParametersvalue - the value whose presence in this map is to be tested ReturnsThis method returns true if this map maps one or more keys to this value. ExceptionNA Example 1Test it NowOutput: Map: {Java=1, Python=2, PHP=3, Android=4, AngularJS=5} Map contains '1': true Map contains '5': true Example 2Test it NowOutput: Map: {Monday=1, Tuesday=2, Wednesday=3, Thursday=4} Map contains '2': true Map contains '4': true
Next TopicJava EnumMap
|