If input value can be in numeric form other than integer , check by
if (x == (int)x)
{
// Number is integer
}
If string value is being passed , use Integer.parseInt(string_var).
Please ensure error handling using try catch in case conversion fails.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…