This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Error that wont go away
It's not a secret anymore!