Verityprep
Question Bank

AP® Computer Science A Multiple Choice Questions

Work through AP Computer Science A multiple-choice 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 1,991–2,000 of 2,811
  1. 1991
  2. 1992
  3. 1993
  4. 1994
  5. 1995
  6. 1996
  7. 1997
  8. 1998
  9. 1999
  10. 2000

Question 1991

Multiple choice Unit 4: Data Collections
Return true if the sum of all 2s is exactly8. 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 1992

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

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 1994

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 1995

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 1996

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 1997

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 1998

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 1999

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 2000

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 1,991 of 2,811
Page 200 of 282