Question: Consider the following code. Please select all that apply. Line 1 : Integer [ ] intArray = { 1 , 2 , 3 } ;

Consider the following code. Please select all that apply.
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];
1. Line 4 is OK. An int value from intArray[0] object is assigned to a double variable d.
2. It is OK to mix an int value with an Integer object in an expression in Line 3.
3. It is OK to automatically convert an Integer object to an int value in Line 2.
4.It is OK to assign 1,2,3 to an array of Integer objects since JDK 1.5.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!