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,041–2,050 of 2,811
  1. 2041
  2. 2042
  3. 2043
  4. 2044
  5. 2045
  6. 2046
  7. 2047
  8. 2048
  9. 2049
  10. 2050

Question 2041

Multiple choice Unit 4: Data Collections
In the following code segment, assume that the string str has been properly declared and initialized. The code segment is intended to print the number of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2042

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2043

Multiple choice Unit 4: Data Collections
Consider the following code segment. ArrayList<String> numbers = new ArrayList<String>(); numbers.add("one"); numbers.add("two"); numbers.add(0, "three");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2044

Multiple choice Unit 4: Data Collections
Consider the following method, which is intended to return a list containing the elements of the parameter myList with all even elements removed. public static…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2045

Multiple choice Unit 4: Data Collections
Consider the following code segment. int[][] points = {{11, 12, 13, 14, 15}, {21, 22, 23, 24, 25}, {31, 32, 33, 34, 35}, {41, 42, 43, 44, 45}}; for (int row =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2046

Multiple choice Unit 4: Data Collections
Consider the following code segment. int[][] arr = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}}; int sum = 0; for (int[] x :…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2047

Multiple choice Unit 4: Data Collections
Consider the following code segment. int[] arr = {4, 2, 2, 3, 1}; int num = 0; for (int k = 0;k…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2048

Multiple choice Unit 4: Data Collections
Consider the following method, which is intended to print the ArrayList names in reverse order. public static void printInReverseOrder(ArrayList<String> names)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2049

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2050

Multiple choice Unit 4: Data Collections
Consider the following code segment. int[][] rectangle = new int[4][5]; / * some statements not shown * / x = rectangle[0]; Assume that x has been previously…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,041 of 2,811
Page 205 of 282