Put all the calls to constructors and methods that can throw an exception. The compiler will give you an error message if you don't put a statement inside that should be inside.
The simplest way...
Type: Posts; User: Norm
Put all the calls to constructors and methods that can throw an exception. The compiler will give you an error message if you don't put a statement inside that should be inside.
The simplest way...
Did you try moving the }catch( ... to the end of the code that uses the file IO classes?
Move the definition of the variables OUTSIDE of the {} in the try{}catch block.
Assign them values inside the {}s.
Or move the catch() below the last place the variables are used.
Take a look at the tutorial:
Catching and Handling Exceptions (The Java™ Tutorials > Essential Classes > Exceptions)
You need to put those lines of code inside of a try{}catch() block for the exception that can be thrown by the code on the line numbers given in the error messages.
Be sure to add a call to the...
Please copy the full text of the error message and paste it here. It has important info about the error.