Re: Java Exception Please Help!



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");
}
.



Relevant Pages

  • Re: Java Exception Please Help!
    ... >caught or declared to be thrown ... > String t = stdin.readLine; ... >I'm not sure how to fix this error. ... Prev by Date: ...
    (comp.lang.java.help)
  • Re: Troubleshooting error in VB 6.0
    ... I do understand the error 94 and the reason it is being thrown. ... perhaps a textbox (or anything that can only accept a string). ... Private Sub ShowRemainder(ByVal Divisor As Long, ...
    (microsoft.public.vb.general.discussion)
  • Re: you canceled the previous operation
    ... the SQL string and print out the string to see what it looks like? ... Looks to me like the problem is you INclause. ... I know what the problem is and even know how you would normally fix ... For Each varItem5 In Me.listFlange.ItemsSelected ...
    (microsoft.public.access.formscoding)
  • Re: Age Calculation
    ... The formula converts your date string into a DateTime type of variable. ... The best thing you could do would be to change the field type to a DateTime ... This could be a bit of work, since you may have to fix other ... >> I succesfully run a query calculating members age from a birthdate field. ...
    (microsoft.public.access.queries)
  • Re: Musing about yard sales, thrift shops and a corner of the barn.
    ... My grand dad has been able to fix anything broken with these and they work as good or better than original. ... Every barn and garage around here has a roll of baling wire (or even grass string) hanging on a nail on the wall to fix things that don't work anymore. ... Arch, old coffee cans are ready made boxes and until you pull the plastic lid off you don't know what you've got in them. ...
    (rec.crafts.woodturning)