Validating an integer or String without try-catch

Posted by Phil on Stack Overflow See other posts from Stack Overflow or by Phil
Published on 2010-03-21T02:47:05Z Indexed on 2010/03/21 2:51 UTC
Read the original article Hit count: 302

Filed under:
|
|
|

Ok, I'm lost. I am required to figure out how to validate an integer and String, but for some stupid reason, I can't use the Try-Catch method. I know this is the easiest way and so all the solutions on the internet are using it.

I'm writing in Java.

The deal is this, I need someone to put in an numerical ID and String name. If either one of the two inputs are invalid I must tell them they made a mistake.

Can someone help me?

© Stack Overflow or respective owner

Related posts about newbie

Related posts about java