Verityprep
Question Bank · Unit 4

AP® Computer Science A Data Collections Practice Questions

Work through AP Computer Science A practice questions on Data Collections, 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 541–550 of 1,222
  1. 541
  2. 542
  3. 543
  4. 544
  5. 545
  6. 546
  7. 547
  8. 548
  9. 549
  10. 550

Question 541

Multiple choice Arrays
public class Tester { private int[] testArray = {3, 4, 5}; /** @param n an int to be incremented by 1 */ public void increment (int n) { n++; } public void…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 542

Multiple choice Arraylists
Refer to the doSomething method below. // postcondition public static void doSomething(ArrayList<SomeType> list, int i, int j) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 543

Multiple choice Recursion
Consider the following method. public static void whatsIt(int n) { if (n > 10) { whatsIt(n /…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 544

Multiple choice Sorting And Searching
A large list of numbers is to be sorted into ascending order. Assuming that a "data movement" is a swap or…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 545

Multiple choice Arrays
Refer to the following class containing the mystery method. public class SomeClass { private int[] arr; /** Constructor. Initializes arr to contain nonnegative…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 546

Multiple choice Sorting And Searching
public class Searcher { private int[] arr; /** Constructor. Initializes arr with integers. */ public Searcher() { /* implementation not shown */ } /**…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 547

Multiple choice Sorting And Searching
public class Searcher { private int[] arr; /** Constructor. Initializes arr with integers. */ public Searcher() { /* implementation not shown */ } /**…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 548

Multiple choice Arrays
Consider the following RandomList class. public class RandomList { private int[] ranList; public RandomList() { ranList = getList(); } /** @return array with…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 549

Multiple choice 2D Arrays
A matrix (two-dimensional array) is declared as int[][] mat = new int[2][3]; Consider the following method. public static void changeMatrix(int[][] mat) { for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 550

Multiple choice Arrays
A programmer plans to write a program that simulates a small bingo game (no more than six players). Each player will have a bingo card with 20 numbers from 0 to…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 541 of 1,222
Page 55 of 123