The constructor expects a double
, a primitive type, in which case, through widening primitive conversion, an int
can be used.
However, in
Double SecondDoubleValue = intValue; // ==> Error
you're trying to assign an int
to a Double
. Those are incompatible types.
Note that boxing conversion
converts expressions of primitive type to corresponding expressions of reference type
so an int
would become an Integer
, but Integer
is still not compatible with Double
.