In my code, one of my methods says:
this.write("stuff")
and the write method is
public void write(String text) throws IOException
{
FileWriter writer = new FileWriter(path, true);
PrintWriter printer = new PrintWriter(writer);
printer.printf("%s" + "%n", text);
printer.close();
}
The thing says that there is an
"unreported exception java.io.IOException; must be caught or declared to be thrown"
for the FileWriter.
What should I put in the try and catch statements to fix the exception?