Verityprep
Question Bank

AP® Computer Science A Practice Questions

Work through AP Computer Science A practice 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,391–2,400 of 3,140
  1. 2391
  2. 2392
  3. 2393
  4. 2394
  5. 2395
  6. 2396
  7. 2397
  8. 2398
  9. 2399
  10. 2400

Question 2391

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 2392

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 2393

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 2394

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 2395

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 2396

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 2397

Free response Unit 4: Data Collections
A printing factory maintains many printing machines that hold rolls of paper. public class Machine { private PaperRoll paper; public Machine(PaperRoll roll) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2398

Free response Unit 4: Data Collections
A hex grid is a type of two-dimensional (2-D) map used by many games to represent the area that tokens, ships, robots, or other types of game pieces can move…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2399

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 2400

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,391 of 3,140
Page 240 of 314