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: Arrays Clear filter

Questions 91–100 of 300
  1. 91
  2. 92
  3. 93
  4. 94
  5. 95
  6. 96
  7. 97
  8. 98
  9. 99
  10. 100

Question 91

Multiple choice Arrays
Return true if the number of 1s exceeds the number of 4s. 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 92

Multiple choice Arrays
For n≥0, return a new int array containing 0 through n−1. Which replacement for /* missing */ makes the method meet its specification for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 93

Multiple choice Arrays
Return true if every value is either1 or 4. 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 94

Multiple choice Arrays
For n≥0, return a new String array with strings"0" through the string for n−1. Which replacement for /* missing */ makes the method meet its specification for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 95

Multiple choice Arrays
Return true if the array has no 1s OR has no 4s. Which replacement for /* missing */ makes the method meet its specification for all valid inputs? public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 96

Multiple choice Arrays
val is everywhere if every adjacent pair contains at least one val. Return whether this holds. 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 97

Multiple choice Arrays
Return true if adjacent 22 or adjacent 44 occurs, but not both. Which replacement for /* missing */ makes the method meet its specification for all…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 98

Multiple choice Arrays
For equal-length arrays, count corresponding values differing by 1 or 2, excluding equal values. Differences are computed in long to avoid overflow. Which…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 99

Multiple choice Arrays
Return true if two7s are adjacent or have exactly one value between them. 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 100

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 91 of 300
Page 10 of 30