public class MyClass {
public static boolean isInteger(String str) {
for (int i = 0; i < str.length(); i++) {
if (!Character.isDigit(str.charAt(i))) {
return false;
}
}
return true;
}
public static void main(String args[]) {
String str = "9674830";
System.out.println(isInteger(str));
}
}
/*
run:
true
*/