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.

Subtopic: Arraylists Clear filter

Questions 101–110 of 225
  1. 101
  2. 102
  3. 103
  4. 104
  5. 105
  6. 106
  7. 107
  8. 108
  9. 109
  10. 110

Question 101

Multiple choice Arraylists
What is printed? int total=3 ArrayList…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 102

Multiple choice Arraylists
For a list of nonempty lowercase words, which segments always remove every word starting with n..z? // Example msg: //…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 103

Multiple choice Arraylists
Return true exactly when an ArrayList of nonnull Integers is strictly increasing. Empty and singleton lists qualify. Which replacement for /* missing */ makes…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 104

Free response Arraylists
Determine if the rate is increasing. If a stock price is increasing, that means the value of it is going up. If the rate that the stock price is increasing is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 105

Multiple choice Arraylists
Count empty lockers. All Locker references are nonnull, and isInUse reports whether a locker is occupied. Which replacement for /* missing */ makes the method…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 106

Multiple choice Arraylists
Consider the following code segment: ArrayList<Integer> list = new ArrayList<Integer>(); for (int i = 1; i <= 8; i++) { list.add(i); } for (int i =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 107

Multiple choice Arraylists
Consider the following code segment with a missing for loop: ArrayList<String> letters = new ArrayList<String>(); letters.add("A"); letters.add("B");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 108

Multiple choice Arraylists
Consider the following code segment: import java.util.ArrayList; public class Main { public static void main(String[] args) { ArrayList<Integer> numbers = new…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 109

Multiple choice Arraylists
Consider the following code segment: import java.util.ArrayList; public class Main { public static void main(String[] args) { ArrayList<String> list = new…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 110

Multiple choice Arraylists
What is printed when the code segment is executed? ArrayList<Integer> lst = new ArrayList<Integer>(); int k = 2; while (lst.size() <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 101 of 225
Page 11 of 23