我一直在寻找这个问题的答案很长一段时间了,因为它似乎大部分时间其简单。我正在尝试逐行读取文件,并在某些情况下将字符串转换为数字。当我写我的代码Interger.parseInt
根本不工作。我尝试了一切,从改变变量的范围到把它作为一个字符串,然后在完成循环后转换,但它只是说Interger
在Interger.parseInt
无法找到。错误:找不到Integer符号做parseInt
package inputout;
import java.io.*;
import java.util.*;
import static java.lang.Integer.parseInt;
public class readfilebuffer {
private String Resname;
private int numberTables;
private int[] maxpertable;
private int[] sbm;
private String[] line4;
public void readFile1(File fin) throws FileNotFoundException {
int count = 0;
try {
FileReader fileReader = new FileReader(fin);
BufferedReader bufferedReader = new BufferedReader(fileReader);
String line;
while ((line = bufferedReader.readLine()) != null) {
if(count==0)
Resname = line;
if(count==1)
numberTables = Interger.parseInt(line);//Interger here "cannot be found"
}
fileReader.close();
System.out.println(numberTables);
} catch (IOException e) {
e.printStackTrace();
}
}
}
,并在count==1
我已经在4
正在读这条线,当我在numberTablles
打印值为0
说'Interger'几次出声来。如果英语不是您的第一语言,请查找该术语。 – 2014-10-12 05:26:41
可能的重复:http://stackoverflow.com/questions/25706216/what-does-a-cannot-find-symbol-compilation-error-mean – 2014-10-12 05:57:04