+ 1
How to convert int to double in java?
how
3 Answers
+ 9
Herrmann is right.
Upcasting is no problem, be careful at downcasting. For more information just search for these tags on Google.
+ 3
You can't convert an integer to a double. Just think about it. You can go the other way around, but not from int to double.
+ 2
You dont need to convert them explicitly because double is bigger than int. This is xalled implicit type conversion. If you want you could also write double d =Double.valueOf (YOUR INT); but you can write double d =YOUR INT too;