Import Java. util. hashmap; import Java. util. map; import Java. util. treemap; public class testmain {public static void main (string [] ARGs) {// the key value of hashmap can be null ,"". map <string, string> strmap1 = new hashmap <string, string> (); strmap1.put (null, "1"); strmap1.put ("", "2 "); strmap1.put ("", "3"); strmap1.put (null, "4"); system. out. println (strmap1.get (null); For (string S: strmap1.keyset () {system. out. println (s) ;}for (string S: strmap1.values () {system. out. println (s);} // the key value of treemap cannot be nullmap <string, string> strmap2 = new treemap <string, string> (); strmap2.put (null, "1"); // strmap2.put ("", "2"); // strmap2.put ("", "3"); // strmap2.put (null, "4 "); // system. out. println (strmap2.get (null); For (string S: strmap2.keyset () {system. out. println (s) ;}for (string S: strmap2.values () {system. out. println (s );}}}