java check value is String in Java code example
Example: java check if string is number
try {
int n = Integer.parseInt(str);
} catch (NumberFormatException e) {
// str is not a number
}
try {
int n = Integer.parseInt(str);
} catch (NumberFormatException e) {
// str is not a number
}