unreported exception java.io.IOexception; must be caught or declared to be thrown
posted 5 years ago
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?
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.