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 161–170 of 225
  1. 161
  2. 162
  3. 163
  4. 164
  5. 165
  6. 166
  7. 167
  8. 168
  9. 169
  10. 170

Question 161

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 162

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 163

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 164

Multiple choice Arraylists
What are the final list contents?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 165

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 166

Multiple choice Arraylists
Consider the following method. public void reviseList(ArrayList<Integer> list) { for (int i = 0; i < list.size(); i++) { int temp = list.get(i); if (temp % 2 ==…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 167

Free response Arraylists
The ItemInfo class is used to store information about an item at a store. A partial declaration of the ItemInfo class is shown. public class ItemInfo { /** *…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 168

Free response Arraylists
A tournament round pairs best-ranked competitors with worst-ranked competitors. Implement the Round constructor and buildMatches. Names are ordered from best to…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 169

Multiple choice Arraylists
Consider the following code segment. What is printed when this code is executed? ArrayList<String> list = new ArrayList<>(); list.add("apple");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 170

Multiple choice Arraylists
Assume that an ArrayList names holds the following values. {"Debbie", "Rob", "Kelly", "Sandy", "Kim", "J.P. ", "Andy", "Tim",…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 161 of 225
Page 17 of 23