Verityprep
Question Bank

AP® Computer Science A Multiple Choice Questions

Work through AP Computer Science A multiple-choice 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,401–2,410 of 2,811
  1. 2401
  2. 2402
  3. 2403
  4. 2404
  5. 2405
  6. 2406
  7. 2407
  8. 2408
  9. 2409
  10. 2410

Question 2401

Multiple choice Unit 4: Data Collections
Consider the following code segment: ArrayList<String> list1 = new ArrayList<String>(); list1.add("a"); list1.add("b"); list1.add(0, "c");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2402

Multiple choice Unit 4: Data Collections
Consider the following recursive method: public static int mystery(String str) { if (str.length() == 1) return 0; else { if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2403

Multiple choice Unit 4: Data Collections
Consider the following array: {7, 3, 8, 5, 2} Which of the following correctly…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2404

Multiple choice Unit 4: Data Collections
Given the following 2D array m: Row 0: 1 1 1 1 Row 1: 1 2 3 4 Row 2: 2 2 2 2 Row 3: 2 4 6 8 Consider the following code segment: int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2405

Multiple choice Unit 4: Data Collections
Consider the following method: public static boolean test(int[] a, int val) { boolean temp = false; for (int i = a.length-1; i >= 0; i--)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2406

Multiple choice Unit 4: Data Collections
Consider the following method: public static int m1(int a) { if (a == 1)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2407

Multiple choice Unit 4: Data Collections
Consider the following Java class: public class Searcher { private int[] arr = {1, 3, 5, 8, 9}; public int mystery(int low, int high, int num) { int mid = (low…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2408

Multiple choice Unit 4: Data Collections
The following incomplete method is intended to sort the array elem in ascending order using the selection sort algorithm. public static void sort(int[] elem) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2409

Multiple choice Unit 4: Data Collections
Consider the following code segment: int[][] mat = new int[3][4]; for (int row = 0;row < mat.length;row++) { for (int col = 0;col < mat[0].length;col++) { if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2410

Multiple choice Unit 4: Data Collections
Given the following method: public int test(int v) { for (int i = 0; i < a.length; i++) { if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,401 of 2,811
Page 241 of 282