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.

Subtopic: Arraylists Clear filter

Questions 91–100 of 173
  1. 91
  2. 92
  3. 93
  4. 94
  5. 95
  6. 96
  7. 97
  8. 98
  9. 99
  10. 100

Question 91

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 92

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 93

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 94

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 95

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 96

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 97

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 98

Multiple choice Arraylists
Consider the following classes Point and Polygon. public class Point { private int x, y; public Point(int _x, int _y) { x = _x; y = _y; } public int getX() {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 99

Multiple choice Arraylists
Consider the following classes Point and Polygon. public class Point { private int x, y; public Point(int _x, int _y) { x = _x; y = _y; } public int getX() {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 100

Multiple choice Arraylists
Consider the following class. public class Buddylist { /** Contains the names of buddies. */ private ArrayList<String> buddies; public ArrayList<String>…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 91 of 173
Page 10 of 18