In JDK 1.5, analyze the following code. Line 1: Integer[] intArray = {1, 2, 3}; Line 2: int i = intArray[0] + intArray[1]; Line 3: int j = i + intArray[2]; Line 4: double d = intArray[0];

In JDK 1.5, analyze the following code.


Line 1: Integer[] intArray = {1, 2, 3};
Line 2: int i = intArray[0] + intArray[1];
Line 3: int j = i + intArray[2];
Line 4: double d = intArray[0];


A. It is OK to assign 1, 2, 3 to an array of Integer objects in JDK 1.5.
B. It is OK to automatically convert an Integer object to an int value in Line 2.
C. It is OK to mix an int value with an Integer object in an expression in Line 3.
D. Line 4 is OK. An int value from intArray[0] object is assigned to a double variable d.

The correct answer is ABCD


Java

Learn More Multiple Choice Question :