In this Java tutorial, you will learn about Integer.doubleValue() method, and how to use this method to get value of Integer object as a double value, with the help of examples.

Integer.doubleValue()

Integer.doubleValue() returns the value of this Integer as a double after a widening primitive conversion.

Syntax

The syntax of doubleValue() method is

</>
Copy
Integer.doubleValue()

Returns

The method returns value of type double.

Example

In this example, we will take an Integer object and get an equivalent double value of this integer object.

Java Program

</>
Copy
public class Example {
	public static void main(String[] args){
		Integer integer = 7;
		double d = integer.doubleValue();
		System.out.println("Result of doubleValue() = "+ d);
	}
}

Output

Result of doubleValue() = 7.0

Conclusion

In this Java Tutorial, we have learnt the syntax of Java Integer.doubleValue() method, and also how to use this method with the help of Java example programs.