下列代码运行结果是什么?
public class Demo01 {
public static void main(String[] args) {
Map<String, Object> map = new HashMap<String, Object>();
test(map);
test2(map);
System.out.println(map);
}
public static void test(Map<String,Object> map) {
map.put("msg", "Hello World");
}
public static void test2(Map<String,Object> map) {
map = new HashMap<String, Object>();
map.put("data", "OK");
}
}
运行结果:
{msg=Hello World}
网友评论