我在同一个程序包中有一个文本文件,我可以通过它来访问它,所以我不明白为什么我会收到此异常。我在哪里出错?
public static boolean someMethod(){
File f = new File("input.txt");
try{
Scanner s = new Scanner(file);
s.useDelimiter(""); //I want to parse by one character at a time
while(s.hasNext()){
...
}
}catch (FileNotFoundException e){
...
}
return false;
}