I would like to know why in Java it gives a compilation error by doing the following operations:
double d34324.34; //error
float f3342.34; //error
On the other hand:
long L32423424; // works fine
double D32432424; // works fine
So basically I would like to know why there is this limitation with the syntax use only for floating point values.
I am aware that if the letter identifier (D,d,F,f) is put at the end of the number it works, but still I would like to know why the other form does not work with floating points.
Just curiosity, I know if I type 3443.43434f it works.
doesn’t assign a value of
34324.34but tries to declare a variable with the invalid named4324.34.You probably wanted