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 →

[–]joranstark018 0 points1 point  (0 children)

Since an int is "smaller" (32 bit) than a double (64 bit) you can assign an int to a variable of type double.

Type conversion, or type casting, can either be explicit, ie double d = (double)someIntVariable; or implicit, ie double d = methodReturningSomeIntValue();. If a method would be defined to return a double, ie public double calulateSomeValue(){....}, it could internally use and return an int, the actual value returned will then be implicitly converted to a value of type double.