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 1,731–1,740 of 2,811
  1. 1731
  2. 1732
  3. 1733
  4. 1734
  5. 1735
  6. 1736
  7. 1737
  8. 1738
  9. 1739
  10. 1740

Question 1731

Multiple choice Unit 3: Class Creation
Consider the following class. public class Pair { private int a; private int b; public Pair(int x, int y) { a = x; b = y; } public void mix() { int old = a; a =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1732

Multiple choice Unit 3: Class Creation
Consider the following class. public class Score { private int value; public Score(int v) { value = v; } public int add(int n) { int old = value; value = value…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1733

Multiple choice Unit 4: Data Collections
Consider the following code segment. ArrayList<Integer> numList = new ArrayList<Integer>(); numList.add(3);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1734

Multiple choice Unit 4: Data Collections
Consider the following recursive method. public static void stars(int num) { if (num == 1) { return; } stars(num - 1); for (int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1735

Multiple choice Unit 4: Data Collections
Consider the following method, which is intended to return the number of local maximum values in an array. Local maximum values are array elements that are…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1736

Multiple choice Unit 4: Data Collections
Consider the following code segment. int[][] values = {{1, 2, 3}, {4, 5, 6}}; int x = 0; for (int j = 0; j < values.length; j++) { for (int k = 0;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1737

Multiple choice Unit 4: Data Collections
Consider the following class definition. public class Book { private int pages; public int getPages() { return pages; } // There may be instance variables,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1738

Multiple choice Unit 4: Data Collections
Consider the following method. public static String[] strArrMethod(String[] arr) { String[] result = new String[arr.length]; for (int j = 0; j < arr.length;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1739

Multiple choice Unit 4: Data Collections
Consider the following method. public static String[] strArrMethod(String[] arr) { String[] result = new String[arr.length]; for (int j = 0; j < arr.length;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1740

Multiple choice Unit 4: Data Collections
Consider the following method, which is intended to print the values in its two-dimensional integer array parameter in row-major order. public static void…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1,731 of 2,811
Page 174 of 282