get value based on key hashmap 2021 code example
Example: 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");