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,381–2,390 of 2,811
  1. 2381
  2. 2382
  3. 2383
  4. 2384
  5. 2385
  6. 2386
  7. 2387
  8. 2388
  9. 2389
  10. 2390

Question 2381

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2382

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2383

Multiple choice Unit 4: Data Collections
Which of the following is (are) true? I. Insertion sort takes longer when the array is sorted in ascending order and you want it sorted in…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2384

Multiple choice Unit 4: Data Collections
Given the following values for a 2D array m and the following code: 1 1 1 1 1 2 3 4 2 2 2 2 2 4 6 8 int sum = 0; for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2385

Multiple choice Unit 4: Data Collections
int len = 4; int[][] matrix = new int[len][len]; int total = 0; for (int row = 0; row < len; row++) { total = total + matrix[row][1]; } Assume…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2386

Multiple choice Unit 4: Data Collections
Consider the following Java class field and method: private List<Integer> list; public void mystery(int n) { for (int i = 0; i < n; i++) { Object obj =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2387

Multiple choice Unit 4: Data Collections
Consider the following method: public static int recur(int n) { if (n <= 1) return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2388

Multiple choice Unit 4: Data Collections
Consider the execution of the following Java code, which manipulates an ArrayList of strings: List<String> list = new ArrayList<String>(); list.add("a");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2389

Multiple choice Unit 4: Data Collections
Given the following method public void m(int[][] p) { int height = p.length; for (int row = 0;row < height / 2;row++) { for (int col =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2390

Multiple choice Unit 4: Data Collections
Given the following recursive method: // precondition: x >= 0 public static void mystery(int x) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,381 of 2,811
Page 239 of 282