So why doesn't this work with floats/doubles, etc?
e.g., why can't I do:
float f = 3.14; //clearly within range & precision of f.
Originally posted by puneet pruthi:
Hi!!
constants which r in range wont throw any error.like byte b=10;though 10 is in range ,still the compiler knows that it is a constant whose value is not going to change and it is within limits so it is okie
another thing which will work is
final int j=30;
byte b=j;
this will also work fine.