how to get the values of hashmap in java code example
Example 1: hashmap get value java
//Import Hashmap
import java.util.HashMap;
HashMap<String, String> dir = new HashMap<String, String>();
//Add key, values
dir.put("hi", "hello");
dir.put("wow", "amazing");
//print value for hi.
System.out.println(dir.get("hi");
Example 2: java get keys from hashmap
//returns as set
hashmap.keySet()