import java.util.HashMap;
// The main method must be in a class named "Main".
class Main {
public static void main(String[] args) {
HashMap<String, String> map = new HashMap<>();
map.put("sunny", "blue");
map.put("cloudy", "grey");
String color;
color = map.get("sunny");
System.out.println(color); // blue
color = map.get("windy");
System.out.println(color); // null
}
}
To embed this project on your website, copy the following code and paste it into your website's HTML: