当前位置: 代码迷 >> J2SE >> 困扰小弟我好久了。求大神解答
  详细解决方案

困扰小弟我好久了。求大神解答

热度:33   发布时间:2016-04-24 00:25:14.0
困扰我好久了。。。。。。求大神解答~
private Address[] read() throws Exception{
Address[] addressArray = new Address[getLineCounts()];
Scanner scanner = new Scanner(new File("address.txt"));
int i=0;
while(scanner.hasNext()){
String[] array = scanner.nextLine().split(",");//line =1,111,111,111,111,111
  addressArray[i++] = new Address(Integer.parseInt(array[0]),array[1],
array[2],array[3],array[4]);
}
  return addressArray;
}
变红的那行出错了,我都快愁死了。。。。。不知道为啥出错,说是找不到符号。

------解决方案--------------------
探讨
private Address[] read() throws Exception{
Address[] addressArray = new Address[getLineCounts()];
Scanner scanner = new Scanner(new File("address.txt"));
int i=0;
while(scanner.hasNext()){
String……
  相关解决方案