Question: 1. (Chapter 18, 50 points) The following code fragment uses arrays in Java. The first line declares and allocates an array of two integers. The
1. (Chapter 18, 50 points) The following code fragment uses arrays in Java. The first line declares and allocates an array of two integers. The next two lines initialize it. (Java arrays are indexed starting from 0.) int [ ] A = new int [2]; A[0] = 0; A[1] = 2; f(A[0], A[A[0]]); Function f is defined as void f(int x, int y) { x = 1; y = 3; } For each of the following parameter-passing methods, say and explain what the final values in the array A would be, after the call to f. (There may be more than one correct answer. Penalty points will be incurred if explanation is missing.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
