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

When adding a node to a linked list, which pointer variable do you update first?

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

To overload the + operator, you would write a function named

a. overload + b. operator + c. function + d. operator.overload(+) e. None of these

Computer Science & Information Technology

The shortcut keys used to center a paragraph are ____.

A. COMMAND-T B. COMMAND-M C. COMMAND-SHIFT-T D. COMMAND-E

Computer Science & Information Technology

What is the maximum number of synchronizations that can be performed automatically per day?

A. 6 B. 12 C. 24 D. 48

Computer Science & Information Technology