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,181–2,190 of 2,811
  1. 2181
  2. 2182
  3. 2183
  4. 2184
  5. 2185
  6. 2186
  7. 2187
  8. 2188
  9. 2189
  10. 2190

Question 2181

Multiple choice Unit 4: Data Collections
Consider the following code segment. String exampleString = "computer"; ArrayList<String> words = new ArrayList<String>(); for (int k = 0; k <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2182

Multiple choice Unit 4: Data Collections
Consider the following recursive method. public void wackyOutput (String wacky) { if (wacky.length() < 1) return; wacky =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2183

Multiple choice Unit 4: Data Collections
Consider the following method which implements an Insertion Sort algorithm. public void sortIt(int[] arr) { for (int i = 1;i < arr.length;i++) { int value =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2184

Multiple choice Unit 4: Data Collections
Consider the following method. public ArrayList<String> rearrange(ArrayList<String> myList) { for (int i = myList.size() / 2; i >= 0; i--) { String wordA =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2185

Multiple choice Unit 4: Data Collections
Consider the following code segment. int [] [] grid = { {0, 1, 2}, {3, 4, 5}, {6, 7, 8}, {9, 10, 11} }; int [] [] newGrid = new int [grid[0].length]…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2186

Multiple choice Unit 4: Data Collections
Consider the following code segment. int[][] grid = new int[3][3]; for (int row = 0;row < grid.length;row++) { for (int col = 0;col <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2187

Multiple choice Unit 4: Data Collections
What can the following method best be described as? public int mystery(int[] array, int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2188

Multiple choice Unit 4: Data Collections
Assume obscureAnimals is an ArrayList<String> that has been correctly constructed and populated with the following items. ["okapi", "aye-aye", "cassowary",…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2189

Multiple choice Unit 4: Data Collections
Consider the following code segment. ArrayList<String> list = new ArrayList<String>(); list.add("P"); list.add("Q"); list.add("R");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2190

Multiple choice Unit 4: Data Collections
Consider the following instance variable and method. private ArrayList<Integer> nums; /** Precondition: nums.size > 0 */ public void numQuest() { int k = 0;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,181 of 2,811
Page 219 of 282