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 31–40 of 173
  1. 31
  2. 32
  3. 33
  4. 34
  5. 35
  6. 36
  7. 37
  8. 38
  9. 39
  10. 40

Question 31

Multiple choice Arraylists
What happens? ArrayList list=new ArrayList ()…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 32

Multiple choice Arraylists
What is wrong with this code? ArrayList list=new…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 33

Multiple choice Arraylists
What is printed? ArrayList list=new ArrayList () list.add(0); list.add(1);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 34

Multiple choice Arraylists
What is printed? ArrayList list=new ArrayList () list.add("I"); list.add("love");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 35

Multiple choice Arraylists
Which declares an ArrayList myTemps…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 36

Multiple choice Arraylists
What does nums contain afterward? ArrayList nums=new ArrayList () nums.add(10); nums.add(20);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 37

Multiple choice Arraylists
What does scales contain afterward? ArrayList scales=new ArrayList () scales.add("DO"); scales.add("RE"); scales.add("MI") scales.add("FA"); scales.add("SO")…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 38

Multiple choice Arraylists
What is printed? ArrayList nums=new…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 39

Multiple choice Arraylists
What is printed? ArrayList list=new ArrayList () list.add("One"); list.add("Two");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 40

Multiple choice Arraylists
The method should return the matching string’s index or−1. Which repair is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 31 of 173
Page 4 of 18