| Author |
unreported exception java.io.IOexception; must be caught or declared to be thrown
|
Andy Reifman-Packett
Greenhorn
Joined: Feb 14, 2012
Posts: 1
|
|
I'm trying to compile this and every time that I do I get the error message "unreported exception java.io.IOexception; must be caught or declared to be thrown" with the line Highscore p1 = new Highscore(named, Accuracy, aTime); highlighted
I realize this is a lot of code and I'm sorry but does anyone have any idea as to why this might be happening?
|
 |
Jeff Verdegan
Bartender
Joined: Jan 03, 2004
Posts: 5874
|
|
The error message is telling you exactly what's wrong. Since the code you're executing can throw that exception, you either have to catch it and handle it, or you have to declare that your method throws it, so your caller knows to expect it.
Google for java exceptions tutorial for an intro to exception handling.
|
 |
 |
|
|
subject: unreported exception java.io.IOexception; must be caught or declared to be thrown
|
|
|