并在Eclipse构建包:内容不能得到解决
public static String getContents(File aFile)
{
contents = new StringBuffer();
BufferedReader input = null;
try
{
input = new BufferedReader(new FileReader(aFile));
String line = null;
while ((line = input.readLine()) != null) {
contents.append(line);
}
return contents.toString();
}
catch (FileNotFoundException ex)
{
ex.printStackTrace();
}
catch (IOException ex)
{
ex.printStackTrace();
}
finally
{
try
{
if (input != null) {
input.close();
}
}
catch (IOException ex)
{
ex.printStackTrace();
}
}
}
我们得到了以下三个错误:
内容不能被解析(上线10号)
内容无法解析(在线数12)
的内容不能被解析为一个变量(在3号线)
我们使用的是Eclipse霓虹灯(4.6.0)和Java jdk1.8.0_102
已经尝试过干净,在Eclipse
刷新
Java中的所有代码都应该在类中。在一个侧面说明,很难找到基于行号的行,没有看到任何 – eavidan
现在我已经粘贴完整的类 – Aly
不,你没有,只有方法...粘贴ENTIRE类开始'公共类.. ' – pczeus