2
Q:

how to make a dictionary in java

Map<String, String> dictionary = new HashMap<String, String>();

dictionary.put("key", "value");
String value = dictionary.get("key");
7
Map<String, String> map = new HashMap<String, String>();
map.put("dog", "type of animal");
System.out.println(map.get("dog"));
6

New to Communities?

Join the community