error: exception java.io.FileNotFoundException

Because you aren’t doing anything to open a file within the try block it’s impossible to throw a File Not Found. Move the Scanner declaration down within the try block and I would expect that’ll fix it. At that point you can remove the “throws” declaration from your method signature.

Leave a Comment