when i attempt to create a BufferedReader using a text file in my workspace the FileReader in the "new bufferedreader statement throws a filenotfoundexception. yet .exists() and .canRead() both return true for the file
public static void main(String[] args) {
File fighter0 = new File("resources/fighter0.txt");
//BufferedReader reader = new BufferedReader(new FileReader(fighter0));
System.out.println(fighter0.exists());
System.out.println(fighter0.canRead());
}
here's the code
true
true
and the output
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Unhandled exception type FileNotFoundException
at main.Core.main(Core.java:21)
and the exception that's thrown when i uncomment the bufferedreader line
i found a closed thread similar to this one, but couldn't find any clear answer in it.