Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Java double-precision integer output is int type, such as 4.0->; four
Java double-precision integer output is int type, such as 4.0->; four
Public class ClassD{

Public static void main(String[] args){

Double a = 4;;

int b =(int)a;

If (a! = b)system . out . println(a);

else system . out . println(b);

}

}

This will do.

system . out . println(a & gt; b? A: b); Because A participates in the operation, it will be automatically converted into double 3.