Multiple Choice
Given the following code and assuming list is an int array that stores positive int values only. Which of the following tasks is accomplished by this code? int foo = 0;
For (int j =0 ; j < list.length; j++)
If (list[j] > foo) foo = list[j];
A) It stores the smallest value of list in foo.
B) It stores the largest value of list in foo.
C) It stores every value of list, one at a time, in list until the loop terminates.
D) It counts the number of elements in list that are greater than foo.
E) It counts the number of elements in list that are less than foo.
Correct Answer:

Verified
Correct Answer:
Verified
Q18: If int[] x = new int[15]; and
Q19: Code Example Ch 08-2<br>Assume you have an
Q20: What does the following statement do? int[]
Q21: Assume list is an array of int
Q22: A ragged array is a multidimensional array
Q24: Which of the following is a legal
Q25: A two-dimensional array named sales holds the
Q26: In Java an array can only store
Q27: The "off-by-one" error associated with arrays arises
Q28: If any int array, a, is passed