aspose file tools*
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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Error that wont go away" Watch "Error that wont go away" New topic
Author

Error that wont go away

Sally Curtis
Greenhorn

Joined: Jan 10, 2004
Posts: 26
hi, i dont know why but i keep get the following error:
unreported exception java.io.IOException; 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 {
askString(...);
}
catch(IOException e) {
// deal with it here
}
or:
yourMethod(arguments) throws IOException {
// your current method here, without catching the exception
}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error that wont go away