Verityprep
Question Bank

AP® Computer Science A Practice Questions

Work through AP Computer Science A practice questions unit by unit, 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 2,261–2,270 of 3,140
  1. 2261
  2. 2262
  3. 2263
  4. 2264
  5. 2265
  6. 2266
  7. 2267
  8. 2268
  9. 2269
  10. 2270

Question 2261

Multiple choice Unit 4: Data Collections
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 2262

Multiple choice Unit 4: Data Collections
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 2263

Multiple choice Unit 4: Data Collections
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 2264

Multiple choice Unit 4: Data Collections
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 2265

Multiple choice Unit 4: Data Collections
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 2266

Multiple choice Unit 4: Data Collections
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 2267

Multiple choice Unit 4: Data Collections
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 2268

Multiple choice Unit 4: Data Collections
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 2269

Multiple choice Unit 4: Data Collections
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 2270

Multiple choice Unit 4: Data Collections
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 2,261 of 3,140
Page 227 of 314