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 121–130 of 173
  1. 121
  2. 122
  3. 123
  4. 124
  5. 125
  6. 126
  7. 127
  8. 128
  9. 129
  10. 130

Question 121

Multiple choice Arraylists
ArrayList<String> list = new ArrayList<String>(); list.add("A"); list.add("B"); list.add("C"); for (String s : list) { String t =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 122

Multiple choice Arraylists
Meetings use half-open intervals[start,end), so touching endpoints do not conflict. For meetings[2,4),[4,6),[3,5), what pair is returned by…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 123

Multiple choice Arraylists
Assume java.util.ArrayList is imported. What is printed? ArrayList list=new ArrayList ()…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 124

Multiple choice Arraylists
What is printed? String[] cities={"Atlanta","Boston","Chicago"} for(String…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 125

Multiple choice Arraylists
For which category of lists does this method always remove every negative element?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 126

Multiple choice Arraylists
Which replacement makes this an unbiased Fisher–Yates shuffle, assuming Math.random() is uniform? int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 127

Multiple choice Arraylists
Complete rateIsIncreasing so it returns true exactly when every daily gain is positive and gains strictly increase. prices contains at least three finite…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 128

Multiple choice Arraylists
Assume ArrayList is imported. What is printed? ArrayList a=new ArrayList ()…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 129

Multiple choice Arraylists
What remains in letters? java.util.ArrayList letters=new…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 130

Multiple choice Arraylists
What is printed? java.util.ArrayList myList=new…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 121 of 173
Page 13 of 18