关于map.put()方法,报java.lang.NullPointerException空指针异常
在Java编程中,时不时就会遇到java.lang.NullPointerException的异常,先来看以下代码:[java]viewplaincopypublicclassTest{privateMapmap;publicvoidtest(){map.put("1","John");map.put("2","Lily");System.out.println(map.toString());}