How to convert Java double to int and int to double with example

Java double to int conversion

You may convert the variable of data type double to int and int to double quite easily in Java programming. The example below shows how to convert that.

A double to int conversion example

The example below converts a double to int in Java and assigns it to a variable.


The output will be:

10

Java int to double conversion example

The example below converts an int to double and assigns it to a variable.


The output will be:

10.0

Also see int to string | string to int

Was this article helpful?

Related Articles

Leave A Comment?