Java adalah nomor
String someString = "123123";
boolean isNumeric = someString.chars().allMatch( Character::isDigit );
coder
String someString = "123123";
boolean isNumeric = someString.chars().allMatch( Character::isDigit );
public static boolean isNumeric(String strNum) {
if (strNum == null) {
return false;
}
try {
double d = Double.parseDouble(strNum);
} catch (NumberFormatException nfe) {
return false;
}
return true;
}
//Add this to your code and call
static private boolean isMyNumber(String s){
try{
Integer.parseInt(s);
return true;
}catch (Exception e){
return false;
}
}