Question: Consider the following method, mystery: What are the values of the elements in array a1 after the following code executes? int[] a1 = {1, 3,
Consider the following method, mystery:
![public static void mystery (int [] a, int [] b) { for (int i = 0; i < a.length; i++) { a[i] += b[b.length - 1 i);](https://dsd5zvtm8ll6.cloudfront.net/si.question.images/images/question_images/1606/8/9/3/7155fc740931b69d1606893715265.jpg)
What are the values of the elements in array a1 after the following code executes?
int[] a1 = {1, 3, 5, 7, 9};
int[] a2 = {1, 4, 9, 16, 25};
mystery(a1, a2);
public static void mystery (int [] a, int [] b) { for (int i = 0; i < a.length; i++) { a[i] += b[b.length - 1 i);
Step by Step Solution
3.28 Rating (169 Votes )
There are 3 Steps involved in it
After the mystery metho... View full answer
Get step-by-step solutions from verified subject matter experts
