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 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