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,181–2,190 of 3,140
  1. 2181
  2. 2182
  3. 2183
  4. 2184
  5. 2185
  6. 2186
  7. 2187
  8. 2188
  9. 2189
  10. 2190

Question 2181

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

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

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

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

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

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

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

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

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

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