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,631–2,640 of 3,140
  1. 2631
  2. 2632
  3. 2633
  4. 2634
  5. 2635
  6. 2636
  7. 2637
  8. 2638
  9. 2639
  10. 2640

Question 2631

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 2632

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 2633

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 2634

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 2635

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 2636

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 2637

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 2638

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 2639

Multiple choice Unit 4: Data Collections
Consider the following code that is part of a class declaration: private int[] myStuff; // precondition: myStuff contains integers in no particular order public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2640

Multiple choice Unit 4: Data Collections
Consider the following declaration of the class RandomList, which has a constructor intended to initialize the instance variable numList to an ArrayList of n…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,631 of 3,140
Page 264 of 314