What do each of the arrays passed in contain after the following method has been executed with
Fantastic news! We've Found the answer you've been seeking!
Question:
What do each of the arrays passed in contain after the following method has been executed with the given arrays?
int[] a = {3, 8, 8, 2, 9, 5, 1, 5, 2}; int[] b = {7, 5, 4, 1, 9, 6, 3, 2, 4}; public static void readArray(int[] a, int[] b) { int x = 0; for(int i = 0; i < a.length; i++) { x = a[i]; a[b[x] % a.length] = b[a[x] % b.length]; a[i]++; } }
Answer should be a format of:
a: [ ]
b: [ ]
Please explain how you got this so I can understand.
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date: