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.