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 531–540 of 1,222
  1. 531
  2. 532
  3. 533
  4. 534
  5. 535
  6. 536
  7. 537
  8. 538
  9. 539
  10. 540

Question 531

Multiple choice Arrays
Consider an array arr that is sorted in increasing order, and method findMost given below. Method findMost is intended to find the value in the array that…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 532

Free response Arraylists
Consider a note keeper object that is designed to store and manipulate a list of short notes. Here are some typical notes: pick up drycleaning special dog chow…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 533

Free response 2D Arrays
Consider the problem of keeping track of the available seats in a theater. Theater seats can be represented with a two-dimensional array of integers, where a…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 534

Multiple choice Arrays
public class Card { private String suit; private int value; //0 to 12 public Card(String cardSuit, int cardValue) {/* implementation */ } public String…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 535

Multiple choice Arrays
Refer to the following method that finds the smallest value in an array. /** Precondition: arr is an array of nonzero length * and is initialized with int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 536

Multiple choice Recursion
When will method whatIsIt cause a stack overflow (i.e., cause computer memory to be exhausted)?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 537

Multiple choice Arrays
The boolean expression a[i] == max…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 538

Multiple choice 2D Arrays
Consider the following code segment. int[][] mat = {{3,4,5}, {6,7,8}}; int sum = 0; for (int[] arr: mat) { for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 539

Multiple choice Arraylists
Consider a Clown class that has a default constructor. Suppose a list ArrayList<Clown> list is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 540

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 531 of 1,222
Page 54 of 123