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.

Questions 341–350 of 1,079
  1. 341
  2. 342
  3. 343
  4. 344
  5. 345
  6. 346
  7. 347
  8. 348
  9. 349
  10. 350

Question 341

Multiple choice Arrays
Which replaces /* more code */ in the constructor to initialize tickList? public class Ticket { private String row private int seat private double price public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 342

Multiple choice Arrays
Which replaces /* code to calculate amount */ in totalPaid, after all ticket entries are initialized? public class Ticket { private String row private int seat…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 343

Multiple choice Arrays
There are NUMSALES transactions. Which declares an array suitable for storing them? public class Ticket { private String row private int seat private double…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 344

Multiple choice Arrays
For a nonempty arr with n=arr.length, which modification makes the minimum-finding segment correct? I: change i=1 to i=0…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 345

Multiple choice Arrays
bookList contains distinct nonnull Book objects. What does the enhanced-for loop do? public class Book { private String title,author private boolean…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 346

Multiple choice Arrays
A bingo game needs one BingoCard reference for each of NUMPLAYERS players. Which declares the array? public class BingoCard…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 347

Multiple choice Arrays
players has been allocated as a BingoCard array but its entries are null. Which constructs and stores each card? public class BingoCard { private int[] card…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 348

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 349

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 350

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 341 of 1,079
Page 35 of 108