Which of the following statements is incorrect?

a. Integer i = 4.5;
b. Double i = 4.5;
c. Object i = 4.5;
d. Number i = 4.5;

a. Integer i = 4.5;
i is an Integer. You cannot assign 4.5 to i. A is incorrect. B, C, and D are correct. 4.5 is autoboxed to new Double(4.5). A Double object is an instance of Object and Double.

Computer Science & Information Technology

You might also like to view...

One fact about a battery charger is that

A) Some mobile devices need to be charged. B) Some mobile devices have an internal battery charger. C) All mobile devices operate on battery power and need to be charged. D) All mobile devices can only be charged with a wall outlet.

Computer Science & Information Technology

A table of figures can be created automatically from ____.

A. index entries B. captions C. page numbers D. figure numbers

Computer Science & Information Technology