java test if a string is a int

Java
public static boolean isInt(String str) {
	
  	try {
    	int x = Integer.parseInt(str);
      	return true; //String is an Integer
	} catch (NumberFormatException e) {
    	return false; //String is not an Integer
	}
  	
}
Source

Also in Java: