mapDemo
package test1;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
public class MapCase {
public static void main(String[] args) {
//("1","a") ("2","b")
Map<String,String> m = new HashMap<>();
m.put("1", "a");
m.put("1", "aaa");
m.put("2", "b");
for(Entry<String, String> obj:m.entrySet()){
System.out.println(obj.getKey()+" "+obj.getValue());
}
}
}