71
Java Convert int to double
We can convert int to double in java using assignment operator. There is nothing to do extra because lower type can be converted to higher type implicitly.
It is also known as implicit type casting or type promotion.
Java int to double Example
Let’s see the simple code to convert int to double in java.
Output:
200.0
Java int to Double Example
We can convert int value to Double object by instantiating Double class or calling Double.valueOf() method.
Let's see the simple code to convert int to Double in java.
Output:
100.0 100.0
Next TopicJava double to int