Privacy Policy Terms Of Use. Copyright © 2006-2010 Java Tutorials and Examples.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
- /*
- * Convert double primitive to Double Object example. Program to convert Java
- * double primitive data type to Double object.
- */
- public class DoublePrimitiveToDouble {
- public static void main(String args[]){
- //new double primitive
- double d = 5.74;
- //Use Double(double d) constructor
- Double dObj1 = new Double(d);
- System.out.println("double converted to Double object: " + dObj1);
- }
- }

Post new comment