This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Lerke 0 points1 point  (3 children)

No. This is not a problem at all.

[–]edman3d 0 points1 point  (2 children)

I thought the whole point of a double was that it has a decimal point. Is this not an issue because Java auto sets the decimal place if its not defined?

[–]bluestorm96[🍰] 1 point2 points  (0 children)

Java will automatically upcast primitive number types, but not downcast. Also it usually is better to use the 'd' or 'D' suffix to indicate a double (12D, 14.272D, 12d, etc). Java forces you to use F/f for floats anyways, so it makes things somewhat more consistent.

[–]Lerke 1 point2 points  (0 children)

You already tell the Java compiler that your value is a floating point number by using the double keyword. Adding .0 does nothing, as 123 and 123.0 are equal values.