Verityprep
Question Bank · Unit 4

AP® Computer Science A Data Collections Multiple Choice Questions

Work through AP Computer Science A multiple-choice questions on Data Collections, then check each answer against a worked solution.

Free · no sign-up Open questions need no account. Sign up or log in to open the rest.

Questions 101–110 of 1,079
  1. 101
  2. 102
  3. 103
  4. 104
  5. 105
  6. 106
  7. 107
  8. 108
  9. 109
  10. 110

Question 101

Multiple choice Arrays
What is the output after this code snippet runs? int[] scores = {80, 92, 91, 68, 88};…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 102

Multiple choice Arrays
Which of the following code snippets gets the THIRD element in the scores array and assigns it to…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 103

Multiple choice Arraylists
Which of these methods will properly traverse two ArrayLists…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 104

Multiple choice Arraylists
Consider the following code segment. ArrayList<String> words = new…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 105

Multiple choice Arrays
Consider the following code segment. int[] nums = new int[51]; for (int k = 0; k < nums.length; k++) nums[k] = 1; for (int k = 3; k <= 50; k += 3)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 106

Multiple choice Arrays
Consider the following method with two missing statements. /** Returns the sum of all positive odd values * among the first n elements of arr. * Precondition: 1…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 107

Multiple choice Sorting And Searching
public void process(int[] a) { for (int i = 1; i < a.length; i++) // Line 1 { int current = a[i]; // Line 2 int j = 0; // Line 3 while (a[j] < current) // Line…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 108

Multiple choice Sorting And Searching
public void process(int[] a) { for (int i = 1; i < a.length; i++) // Line 1 { int current = a[i]; // Line 2 int j = 0; // Line 3 while (a[j] < current) // Line…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 109

Multiple choice Arraylists
The two versions of the search method shown below are both intended to return true if ArrayList<Object> list contains the target value; otherwise they are…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 110

Multiple choice Recursion
Consider the following recursive method. public static void printSomething(int n) { if (n…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 101 of 1,079
Page 11 of 108