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 51–60 of 225
  1. 51
  2. 52
  3. 53
  4. 54
  5. 55
  6. 56
  7. 57
  8. 58
  9. 59
  10. 60

Question 51

Multiple choice Arraylists
A program reads an unknown number of text-file…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 52

Multiple choice Arraylists
For intensive calculations over a fixed-size list of numeric values,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 53

Multiple choice Arraylists
Which statement causes a type error? ArrayList strList=new…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 54

Multiple choice Arraylists
list is ArrayList with [2,5,7,6,0,1].…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 55

Multiple choice Arraylists
list is nonempty and sorted in decreasing string order. When does insert fail? public void…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 56

Multiple choice Arraylists
If list initially contains [6,1,8], what does it…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 57

Multiple choice Arraylists
Assume coins contains nonnull Coin objects. Which replaces /* more code */ in getTotal? public class Coin { private double value private String name public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 58

Multiple choice Arraylists
In Purse.find, coins and aCoin are nonnull. Coins with the same name have the same value, and vice versa. Which replacement detects a match? public class Coin {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 59

Free response Arraylists
A game uses square tiles that have numbers on their sides. Each tile is labeled with a number on each of its four sides and may be rotated clockwise, as…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 60

Free response Arraylists
This question involves reasoning about pairs of words that are represented by the following WordPair class. public class WordPair { /** Constructs a WordPair…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 51 of 225
Page 6 of 23