How to check an input number?
Hi!Just want to know how I'm going to do to check that an input number is an int? And not a float, String etc.If the input number isn't an int, I want the program to shut down!/Mike
[211 byte] By [
micottoa] at [2007-10-2 2:08:04]

How about something like...
String inputString;
// read into inputString somehow
int value;
try {
value = Integer.parseInt( inputString );
} catch( NumberFormatException nfe ) {
System.err.println( "the inputString does not contain an integer" );
}