1// Primitive type
2int myInt = 5;
3double myDouble = (double)myInt; // explicit cast
4myDouble = myInt; // implicit cast
5// Object type
6Double myDouble = new Double(myInt) // via constructor
7myDouble = Double.valueOf(myInt) // via valueOf
1Double d= new Double(i);//first way
2Double d2=Double.valueOf(i);//second way