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,741–1,750 of 2,811
  1. 1741
  2. 1742
  3. 1743
  4. 1744
  5. 1745
  6. 1746
  7. 1747
  8. 1748
  9. 1749
  10. 1750

Question 1741

Multiple choice Unit 4: Data Collections
Consider the following method. public static int calcMethod(int num) { if (num == 0) { return 10;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1742

Multiple choice Unit 4: Data Collections
Consider an integer array nums, which has been properly declared and initialized with one or more values. Which of the following code segments counts the number…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1743

Multiple choice Unit 4: Data Collections
Consider the following code segment. String[][] letters = {{"A", "B", "C", "D"}, {"E", "F", "G", "H"}, {"I", "J", "K", "L"}}; for (int col = 1; col <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1744

Multiple choice Unit 4: Data Collections
The following method is intended to remove all elements of an ArrayList of integers that are divisible by key and add the removed elements to a new ArrayList,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1745

Multiple choice Unit 4: Data Collections
Consider the mode method, which is intended to return the most frequently occurring value (mode) in its int[] parameter arr. For example, if the parameter of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1746

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1747

Multiple choice Unit 4: Data Collections
Consider the following recursive method. public static boolean recurMethod(String str) { if (str.length() <= 1) { return true; } else if (str.substring(0,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1748

Multiple choice Unit 4: Data Collections
Consider the following instance variable and method. private int[] arr; /** Precondition: arr.length > 0 * @return the largest value in array arr */ public int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1749

Multiple choice Unit 4: Data Collections
Consider the following method. public static int[] operation(int[][] matrix, int r, int c) { int[] result = new int[matrix.length]; for (int j = 0 ; j <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1750

Multiple choice Unit 4: Data Collections
Consider the following instance variable and method. private int[] numbers; public void mystery(int x) { for (int k = 1; k < numbers.length; k = k + x) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1,741 of 2,811
Page 175 of 282