String[] keys = new String[payGroupMap.size()];
Set set = payGroupMap.keySet();
Iterator iterator = set.iterator();
int i=0;
while(iterator.hasNext()){
keys[i] = iterator.next().toString();
i++;
}
Exception in thread "main" java.lang.NullPointerException 麻烦大家帮看看..谢谢
payGroupMap这个肯定不是空..
或者iterator.next()为null
楼主看看
Map payGroupMap = new HashMap();
payGroupMap.put(null, "");
String[] keys = new String[payGroupMap.size()];
Set set = payGroupMap.keySet();
Iterator iterator = set.iterator();
int i=0;
while(iterator.hasNext()){
keys[i] = iterator.next().toString();
i++;
}报错行keys[i] = iterator.next().toString();
HashMap可以建立key为空的映射的。