Javatpoint Logo
Javatpoint Logo

Java Convert double to int

We can convert double to int in java using typecasting. To convert double data type into int, we need to perform typecasting.

Java Convert double to int

Typecasting in java is performed through typecast operator (datatype).

Here, we are going to learn how to convert double primitive type into int and Double object into int.

Java double to int Example: Typecasting

Let's see the simple code to convert double to int in java.

Test it Now

Output:

10

Java Double to int Example: intValue() method

We can convert Double object to int by intValue() method of Double class. Let's see the simple code to convert Double to int in java.

Test it Now

Output:

10
Next TopicJava char to int




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


B.Tech / MCA