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,161–2,170 of 2,811
  1. 2161
  2. 2162
  3. 2163
  4. 2164
  5. 2165
  6. 2166
  7. 2167
  8. 2168
  9. 2169
  10. 2170

Question 2161

Multiple choice Unit 4: Data Collections
Assume int[] arr has been correctly instantiated and is of sufficient size. Which of these code segments results in identical arrays? I. int i = 1; while (i…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2162

Multiple choice Unit 4: Data Collections
Consider the following code segment. ArrayList<String> nations = new ArrayList<String>(); nations.add("Argentina"); nations.add("Canada");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2163

Multiple choice Unit 4: Data Collections
Consider the following method. public int doStuff(int[] numberArray) { int index = 0; int maxCounter = 1; int counter = 1; for (int k = 1; k <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2164

Multiple choice Unit 4: Data Collections
Consider the following method. public int changeEm(int num1, int num2, int[] values) { num1 = values[num2]; values[num1] = num2; num2++; return num2; } Consider…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2165

Multiple choice Unit 4: Data Collections
The following code segment appears in the main method of another class. AnotherClass[] acArray = new AnotherClass[10]; acArray[2] = new AnotherClass("two");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2166

Multiple choice Unit 4: Data Collections
A programmer intends to apply the standard Binary Search algorithm on the following array of integers. The standard Binary Search algorithm returns the index of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2167

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2168

Multiple choice Unit 4: Data Collections
Consider the following code segment. ArrayList<Integer> newList = new ArrayList<Integer>(); Integer[] list = {2, 4, 3, 3, 2, 5, 1}; newList.add(list[0]); for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2169

Multiple choice Unit 4: Data Collections
Consider the following code segment. int [] [] a = new int [5] [5]; for (int r = 0;r < a.length;r++) for (int c = r + 1;c < a[0].length;c++) a[r][c] = 9; for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2170

Multiple choice Unit 4: Data Collections
Consider the following sorting method. public void mysterySort(int[] arr) { for (int j = 1; j < arr.length; j++) { int temp = arr[j]; int index = j; while…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,161 of 2,811
Page 217 of 282