1public static boolean isInt(String str) {
2
3 try {
4 @SuppressWarnings("unused")
5 int x = Integer.parseInt(str);
6 return true; //String is an Integer
7 } catch (NumberFormatException e) {
8 return false; //String is not an Integer
9 }
10
11}