1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| Map map = new HashMap(); Object obj = null; obj = map.put(null, null); System.out.println(obj); //null obj = map.put(null, "123"); System.out.println(obj); //null obj = map.put(null, null); System.out.println(obj); //123
obj = map.put(1, 123); System.out.println(obj); //null obj = map.put(1, "123"); System.out.println(obj); //123 obj = map.put(1, 123); System.out.println(obj); //123
|