Verityprep
Question Bank · Unit 4

AP® Computer Science A Data Collections Multiple Choice Questions

Work through AP Computer Science A multiple-choice 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 511–520 of 1,079
  1. 511
  2. 512
  3. 513
  4. 514
  5. 515
  6. 516
  7. 517
  8. 518
  9. 519
  10. 520

Question 511

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 512

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 513

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 514

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 515

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 516

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 517

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 518

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 519

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 520

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 511 of 1,079
Page 52 of 108