File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Error that wont go away Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Error that wont go away" Watch "Error that wont go away" New topic

Error that wont go away

Sally Curtis

Joined: Jan 10, 2004
Posts: 26
hi, i dont know why but i keep get the following error:
unreported exception; must be caught or declared to be thrown
problem=askString("type in the first problem.",1);
anyone know why this might be happening?
Billybob Marshall
Ranch Hand

Joined: Jan 27, 2004
Posts: 202
Without any more detail given, it would appear that the mystical method "askString" might throw an IOException, so you have to put a try/catch block around it and deal with the exception yourself, or let the exception pass up to the caller. So either:
try {
catch(IOException e) {
// deal with it here
yourMethod(arguments) throws IOException {
// your current method here, without catching the exception
I agree. Here's the link:
subject: Error that wont go away
jQuery in Action, 3rd edition