Given the q2() method below: public static int q2(int[] array) { int index = 0; for (int
Fantastic news! We've Found the answer you've been seeking!
Question:
Given the q2() method below:
public static int q2(int[] array) {
int index = 0;
for (int i = 0; i < array.length; i++) {
if (array[i] < array[index]) index = i;
}
return index;
}
What would be the output on the console after executing the following code segment?
int[] array = {22, 99, 11, 99, 33};
System.out.println(q2(array));
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date: