java program to see if a integer is valid code example Example: how to check if number is integer in java if(x == (int)x){ println("x is an integer"); }