@override public void run(string... args) throws exception { concurrenthashmap<string, string> concurrenthashmap = new concurrenthashmap<>(); concurrenthashmap.put(null, "1");//npe concurrenthashmap.put("1", null);//npe concurrenthashmap.get(null);//npe hashmap<string, string> hashmap = new hashmap<>(); hashmap.put(null, "1");//ok hashmap.put("1", null);//ok system.out.println(hashmap.get(null));//"1" system.out.println(hashmap.get("1"));//null }
如对本文有疑问, 点击进行留言回复!!
详解SpringBoot修改启动端口server.port的四种方式
网友评论