Multiple Choice
What does the following code do? Assume list is an array of int values, temp is some previously initialized int value, and c is an int initialized to 0. for (j = 0; j < list.length; j++)
If (list[j] < temp) c++;
A) It finds the smallest value and stores it in temp.
B) It finds the largest value and stores it in temp.
C) It counts the number of elements equal to the smallest value in list.
D) It counts the number of elements in list that are less than temp.
E) It sorts the values in list to be in ascending order.
Correct Answer:

Verified
Correct Answer:
Verified
Q30: Although insertion sort and selection sort have
Q31: An interface reference can refer to any
Q32: Code Example Ch 10-1<br>An int array
Q33: Given the following code, class Aggregate is
Q34: A method's parameter can be polymorphic, giving
Q36: It is possible to sort an array
Q37: In order to determine the type that
Q38: To swap the 3rd and 4th elements
Q39: Which of the following methods will sort
Q40: Code Example Ch 10-1<br>An int array