public class arraylst
{
static HashMap<String,List<String>>hm;
public static void main(String[] args)
{
hm.put("2",Arrays.asList("a","b","c"));
}
}
I don’t understand why this causes NullPointerException.
Can someone please help me out?
You need to set
hm:before you use it.