Kod
if (x instanceof Integer)
Zakładając że x jest typu String, kompilator rzuci w Ciebie wyjątkiem

Najprościej będzie zaimplementować tak, jak mówi dr_bonzo, Integer.parseInt() i łapanie wyjątku:
Kod
public static boolean isInt(String str) {
try {
Integer.parseInt(str);
} catch (NumberFormatException e) {
return false;
}
return true;
}