Question: a) What is wrong with the following statement? Explain. int[] a; a[0] = 5; (b) Suppose that the variables a and b are references to

a) What is wrong with the following statement? Explain. int[] a; a[0] = 5;

(b) Suppose that the variables a and b are references to arrays of integers. What is the value of b[0] and b[1] after the following statements have been executed? Explain why. a[0] = 1; b[0] = 2; b = a; b[1] = 3; a[1] = 4;

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!