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 191–200 of 225
  1. 191
  2. 192
  3. 193
  4. 194
  5. 195
  6. 196
  7. 197
  8. 198
  9. 199
  10. 200

Question 191

Multiple choice Arraylists
ArrayList<Integer> list = null;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 192

Multiple choice Arraylists
ArrayList<Integer> list = new…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 193

Multiple choice Arraylists
ArrayList<String> list = null;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 194

Multiple choice Arraylists
ArrayList<String> list = new ArrayList<String>();…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 195

Multiple choice Arraylists
ArrayList<String> list = new ArrayList<String>();…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 196

Free response Arraylists
This question involves the design of a class that maintains a collection of books on a library shelf. The following Book class is provided. public class Book {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 197

Multiple choice Arraylists
public static ArrayList<Integer> buildList(int[] arr) { ArrayList<Integer> result = new ArrayList<Integer>(); for (int val : arr) { if (val % 2 == 0)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 198

Multiple choice Arraylists
public static void removeNegatives(ArrayList<Integer> list) { for (int i = 0;i < list.size();i++) { if (list.get(i) < 0)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 199

Multiple choice Arraylists
The Player class is defined as follows: public class Player { private String name; private int score; public Player(String name, int score) { this.name = name;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 200

Multiple choice Arraylists
public static void insertBeforeOld(ArrayList<String> words) { for (int i = 0;i < words.size();i++) { if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 191 of 225
Page 20 of 23