What is Integer.doubleValue in Java?

What is the doubleValue() method?

The doubleValue() method of the Integer class is an instance method used to convert the Integer value to a double value.

Syntax


public double doubleValue()

Parameters

The method accepts no parameters.

Returns

The method doubleValue() returns the double value of the integer.

Code

In the code below, we create an instance of the Integer class and use the doubleValue() method on the instance to get the double value of the integer.

public class Main {
public static void main(String[] args){
Integer integer = 134;
double doubleValue = integer.doubleValue();
System.out.println(doubleValue);
}
}

Free Resources