问题描述
|
public StormAnalysis(){
try {
fScanner = new Scanner(new File(\"tracks1949to2010_epa.txt\"));
while(fScanner.hasNextLine()){
System.out.println(fScanner.nextLine());
}
} catch (FileNotFoundException e) {
System.out.println(\"File not found. Try placing the tracks1949to2010_epa.txt in the same folder as StormAnalysis.java\");
e.printStackTrace();
}
}
以上是我的代码(并且我也有错误的图片:
http://folk.uio.no/arnabkd/test/images/error-code-task.jpg
如您所见,该txt文件与StormAnalysis.java文件位于同一文件夹中。另外,如果我将文件路径更改为\“ weather.dat \”(作为另一个任务/问题给出),该代码将起作用。
任何想法将不胜感激!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)