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.

Subtopic: Arrays Clear filter

Questions 81–90 of 341
  1. 81
  2. 82
  3. 83
  4. 84
  5. 85
  6. 86
  7. 87
  8. 88
  9. 89
  10. 90

Question 81

Multiple choice Arrays
What is printed? String[]…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 82

Multiple choice Arrays
What is printed? int[] numbers={1,2,3,4,5}…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 83

Multiple choice Arrays
When run() is invoked, what happens? public class SayHello { public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 84

Multiple choice Arrays
Return the count of even integers, including 0. 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 85

Multiple choice Arrays
For a nonempty array whose maximum-minus-minimum fits in int, return that difference. 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 86

Multiple choice Arrays
Return the centered average: remove exactly one smallest and one largest occurrence, then use integer division. Length≥3; sum fits in int. Which replacement for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 87

Multiple choice Arrays
Sum values, excluding every 13 and any value immediately after a13; empty input gives0. Sum fits in int. Which replacement for /* missing */ makes the method…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 88

Multiple choice Arrays
Sum the array except sections starting at a6 and ending at the next7 inclusive. Every 6 has a later7. Sum fits in int. Which replacement for /* missing */ makes…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 89

Multiple choice Arrays
Return true if a2 is adjacent to another2. 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 90

Multiple choice Arrays
Return true if there are no 1s and no 3s. 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 81 of 341
Page 9 of 35