public String[] getKey(String aFilePathONE){
String[] Tempsuzu;
ArrayList lstParam = getFileLine(aFilePathONE);
for (int i = 0; i < lstParam.size(); i++) {
String strLine = (String) lstParam.get(i);
int nIndex = strLine.indexOf(SGFileCodeDefine.FILE_DIVIDE_FLAG);
String Key=strLine.substring(0, nIndex);
Tempsuzu[i]=Key;
}
return Tempsuzu;
}这个函数Eclipse没有提示错误,编译的时候在Tempsuzu[i]=Key;处出现空指针错误单步调试到String Key=strLine.substring(0, nIndex处时
Key 为4002,
String[] Tempsuzu;
ArrayList lstParam = getFileLine(aFilePathONE);
for (int i = 0; i < lstParam.size(); i++) {
String strLine = (String) lstParam.get(i);
int nIndex = strLine.indexOf(SGFileCodeDefine.FILE_DIVIDE_FLAG);
String Key=strLine.substring(0, nIndex);
Tempsuzu[i]=Key;
}
return Tempsuzu;
}这个函数Eclipse没有提示错误,编译的时候在Tempsuzu[i]=Key;处出现空指针错误单步调试到String Key=strLine.substring(0, nIndex处时
Key 为4002,
解决方案 »
- java中打印返回值的问题
- 小弟请求
- java Applet如何在cmd下用main()也能同样运行?
- TextField能设置字体颜色吗?怎么设置?
- 打包后如何读取包中的文件
- 大家都来看看,写文件时,如果数据量非常大,怎样在占用固定内存下高效的进行写操作。
- String.replaceAll()的问题,谢谢大家的帮忙!
- 有写sql server 的存储过程的参考资料?
- APPLET下调用数据库的问题
- 一个java初学者的小问题,请各位指点一下。
- GUI+Mysql 如何实现一个简单的购物系统(把选中物品显示到另外一个JFram中) 加急求教!!!!!!
- 怎么用java实现C中用栈来实现的"表达式计算"?
String[] Tempsuzu=new String[lstParam.size()];
你那个只是创建了个指针,并不指向任何对象,所以肯定是空的