java.lang.Double.<init>(java.lang.Integer)
时间: 2023-05-28 17:04:58 浏览: 181
JAVA转byte[]为int,long,double
4星 · 用户满意度95%
This code will result in a compilation error because the constructor for the Double class does not accept an argument of type Integer. The Double constructor accepts a parameter of type double or String.
To convert an Integer to a Double, you can use the Double.valueOf() method or simply cast the Integer to a double:
```
Integer myInt = 10;
Double myDouble = Double.valueOf(myInt); // or Double myDouble = (double) myInt;
```
阅读全文