Question: Line 1 : Integer [ ] intArray = { 1 , 2 , 3 } ; Line 2 : int i = intArray [ 0

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];
Line 4 is OK. An int value from intArray[0] object is assigned to a double variable d.
It is OK to automatically convert an Integer object to an int value in Line 2.
It is OK to mix an int value with an Integer object in an expression in Line 3.
It is OK to assign 1,2,3 to an array of Integer objects since JD

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 Databases Questions!