To access a value in the HashMap
, use the get()
method and refer to its key:
Example
capitalCities.get("England");
Practice Excercise Practice now
To access a value in the HashMap
, use the get()
method and refer to its key:
capitalCities.get("England");
Practice Excercise Practice now