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