Skip to content

re: Why does this Java code keep throwing Exception in thread "main" at line 8 when line 8 is the declaration for the main method? VIEW POST


Others have pretty much answered, but another thing is that you should try and catch an exception for since it can throw an IOException if the file is not found. This will require defining it in a method.

code of conduct - report abuse