Java EnumMap get() methodThe get() method of Java EnumMap class is used to get the mapped value of the specified key. SyntaxParameterskey - the key whose associated value is to be returned ReturnsThis method returns the value to which the specified key is mapped.
ExceptionNA Example 1Output: Map: {CSS=1, Python=2, PHP=3, Java=4} Tutorial.CSS value: 1 Tutorial.Javascript value: null Example 2Output: Map: {Monday=1, Tuesday=2, Wednesday=3} Days.Monday value: 1 Days.Thursday value: null Example 3Output: Map: {January=1, February=2, March=3, April=4} Months.March value: 3 Months.May value: null Next TopicJava-enummap-hashcode-method |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India