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,441–2,450 of 3,140
  1. 2441
  2. 2442
  3. 2443
  4. 2444
  5. 2445
  6. 2446
  7. 2447
  8. 2448
  9. 2449
  10. 2450

Question 2441

Multiple choice Unit 4: Data Collections
Consider the following declaration. ArrayList<Integer> list = new ArrayList<Integer>(); Which of the following code segments will place the integers 1 to 10, in…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2442

Multiple choice Unit 4: Data Collections
Assume that a Book class has a compareTo method in which, if b1 and b2 are Book objects, b1.compareTo(b2) is a negative integer if b1 is less than b2, a…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2443

Multiple choice Unit 4: Data Collections
Refer to the static method removeNegs shown below. /** Precondition: list is an ArrayList<Integer>. * Postcondition: All negative values have been removed from…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2444

Multiple choice Unit 4: Data Collections
A sorted list of 120 integers is to be searched to determine whether the value 100 is in the list. Assuming…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2445

Multiple choice Unit 4: Data Collections
Consider a sorted array arr of n elements, where n is large and n is even. Under which conditions will a sequential search of arr be faster…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2446

Multiple choice Unit 4: Data Collections
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 2447

Multiple choice Unit 4: Data Collections
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 2448

Multiple choice Unit 4: Data Collections
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 2449

Multiple choice Unit 4: Data Collections
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 2450

Free response Unit 4: Data Collections
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 2,441 of 3,140
Page 245 of 314