Validating an integer or String without try-catch
- by Phil
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?