import java.util.HashMap;
public class Main {
public static void main(String[] args) {
HashMap<String, String> countryCapitals = new HashMap<>();
countryCapitals.put("France","Paris");
countryCapitals.put("Italy", "Rome");
countryCapitals.put("Norway", "Oslo");
countryCapitals.put("US", "Washington DC");
System.out.println( countryCapitals.values());
}
}
// Output: [Oslo, Rome, Paris, Washington DC]
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter