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.

Questions 271–280 of 1,222
  1. 271
  2. 272
  3. 273
  4. 274
  5. 275
  6. 276
  7. 277
  8. 278
  9. 279
  10. 280

Question 271

Multiple choice Arrays
Return true if a1 has a2 somewhere later. Which replacement for /* missing */ makes the method meet its specification for all valid inputs? public boolean…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 272

Multiple choice Arrays
Return true if any three adjacent values are all even or all odd. Which replacement for /* missing */ makes the method meet its specification for all valid…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 273

Multiple choice Arrays
Return true if exactly three3s occur and no two are adjacent. Which replacement for /* missing */ makes the method meet its specification for all valid inputs?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 274

Multiple choice Arrays
Return true if every 2 has another2 immediately before or after it. Which replacement for /* missing */ makes the method meet its specification for all valid…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 275

Multiple choice Arrays
For 0≤len≤nums.length, return whether the first len values equal the last len values in the same order. Which replacement for /* missing */ makes the method…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 276

Multiple choice Arrays
Return true if an adjacent triple increases by exactly1 each time. Arithmetic is within int range. Which replacement for /* missing */ makes the method meet its…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 277

Multiple choice Arrays
For end≥start, return the integers from start inclusive to end exclusive. The length fits in int. Which replacement for /* missing */ makes the method meet its…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 278

Multiple choice Arrays
Rotate left by one; empty input remains empty. Which replacement for /* missing */ makes the method meet its specification for all valid inputs? public int[]…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 279

Multiple choice Arrays
Propagate each encountered multiple of 10 through later nonmultiples until another multiple of 10 is reached. Which replacement for /* missing */ makes the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 280

Multiple choice Arrays
The nonempty array contains a4. Return a new array of all elements before the first 4. Which replacement for /* missing */ makes the method meet its…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 271 of 1,222
Page 28 of 123