Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to judge integer and floating point number in java
How to judge integer and floating point number in java
Common class test {

Public static void main(String []args){

Java . util . scanner SCA = new Java . util . scanner(system . in);

System.out.println ("enter a number");

double a = SCA . next double();

int b =(int)a;

int c = b;

If (c! =a){

System.out.println ("floating point number entered!" );

} Otherwise {

System.out.println ("You entered an integer!" );

}

}

}