Verityprep
Question Bank · Unit 4

AP® Computer Science A Data Collections Practice Questions

Work through AP Computer Science A practice 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,222
  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

Free response Arraylists
The factory keeps track of its printing machines in array machines, and it keeps track of its paper supply in two lists: newRolls to hold fresh rolls and…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 105

Free response Arrays
Customers are ordered alphabetically by name, then by positive integer ID when names match. Matching names and IDs identify equal customers. Complete both…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 106

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 107

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 108

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 109

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 110

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 101 of 1,222
Page 11 of 123