Verityprep
Question Bank

AP® Computer Science A Practice Questions

Work through AP Computer Science A practice questions unit by unit, 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 2,021–2,030 of 3,140
  1. 2021
  2. 2022
  3. 2023
  4. 2024
  5. 2025
  6. 2026
  7. 2027
  8. 2028
  9. 2029
  10. 2030

Question 2021

Multiple choice Unit 4: Data Collections
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 2022

Free response Unit 4: Data Collections
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 2023

Free response Unit 4: Data Collections
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 2024

Multiple choice Unit 4: Data Collections
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 2025

Multiple choice Unit 4: Data Collections
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 2026

Multiple choice Unit 4: Data Collections
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 2027

Multiple choice Unit 4: Data Collections
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 2028

Multiple choice Unit 4: Data Collections
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 2029

Multiple choice Unit 4: Data Collections
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 2030

Multiple choice Unit 4: Data Collections
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 2,021 of 3,140
Page 203 of 314