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 501–510 of 1,079
  1. 501
  2. 502
  3. 503
  4. 504
  5. 505
  6. 506
  7. 507
  8. 508
  9. 509
  10. 510

Question 501

Multiple choice Arrays
Refer to the following data field and method. private int[] arr; /** Precondition: arr.length > 0 and index < arr.length. */ public void remove(int index) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 502

Multiple choice 2D Arrays
A matrix class that manipulates matrices contains the following declaration. private int[][] mat = new int[numRows][numCols]; Consider the following method that…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 503

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 504

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 505

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 506

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 507

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 508

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 509

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 510

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 501 of 1,079
Page 51 of 108