Re: Java Exception Please Help!
- From: Fabien Bergeret <fabien.bergeret@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 07 Nov 2005 11:52:28 +0100
toy wrote:
Miller_Rabin.java:24: unreported exception java.io.IOException; must be caught or declared to be thrown String t = stdin.readLine();
I'm not sure how to fix this error. someone please help. I have a line in my code that says:
String t = stdin.readLine(); s = Integer.parseInt(t);
which is the line that's generating the exception
I can provide additional details if necessary
try {
String t = stdin.readLine();
s = Integer.parseInt(t);
}
catch(IOException e){
System.err.println("Unable to read from stdin");
}
catch(NumberFormatException e) {
System.err.println("What you typed is definitely not a number");
}
.- Follow-Ups:
- Re: Java Exception Please Help!
- From: toy
- Re: Java Exception Please Help!
- References:
- Java Exception Please Help!
- From: toy
- Java Exception Please Help!
- Prev by Date: Re: Class Loading from Byte Stream
- Next by Date: Re: constructor and null pointer
- Previous by thread: Java Exception Please Help!
- Next by thread: Re: Java Exception Please Help!
- Index(es):
Relevant Pages
|