how to check number format exception in java code example
Example: how to check number format exception in java
try {
int i = Integer.parseInt(s);
// s is a valid integer
}
catch (NumberFormatException e) {
// s is not a valid integer
}