When you initialize yours Doubleas follows:
Double a = 1;
There should be 2 things done:
- Boxing
intupInteger - Extension from
IntegertoDouble
Although boxing is in order, expansion from Integerto is Doubleunacceptable. Therefore, it does not compile.
, Java , , JLS & sect; 5.2:
:
- (§5.1.1)
- (§5.1.2)
- (§5.1.5)
- (§5.1.7),
- (. 5.1.8), .
2 nd .
3 rd .