java - double field type declaration as zero -
what significant difference between following 0 double variable declaration: 0.0
vs 0d
double d1 = 0.0; double d2 = 0d;
i understand both these better 0
,because more obvious code reader.
however 0.0
vs 0d
difference not clear me.
there no difference. have @ java language specification, section 3.10.2
decimalfloatingpointliteral:
digits . digits
optexponentpart
optfloattypesuffix
opt. digits exponentpart
optfloattypesuffix
optdigits exponentpart floattypesuffix
optdigits exponentpart
optfloattypesuffix
...
floattypesuffix: 1 of
f f d d
both decimalfloatingpointliteral
, first 1 type 1, second 1 type 4
Comments
Post a Comment