Yussef
Fledgling Freddie
- Joined
- Dec 22, 2003
- Messages
- 789
This is my method with the file output:
When I try calling it, by using Stock(); I get the following error:
unreported exception java.io.IOException; must be caught or declared to be thrown
I've tried Stock() throws IOException; etc, but no luck. Can anyone suggest some solutions?
Code:
public static void Stock() throws IOException
{
FileWriter writer = new FileWriter("Stock.rtf");
PrintWriter printer = new PrintWriter(writer);
printer.print(Order);
printer.close();
}
When I try calling it, by using Stock(); I get the following error:
unreported exception java.io.IOException; must be caught or declared to be thrown
I've tried Stock() throws IOException; etc, but no luck. Can anyone suggest some solutions?