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.

Questions 141–150 of 1,079
  1. 141
  2. 142
  3. 143
  4. 144
  5. 145
  6. 146
  7. 147
  8. 148
  9. 149
  10. 150

Question 141

Multiple choice Arrays
What is arr after mystery()? private int[]…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 142

Multiple choice Arrays
For a nonempty int array arr, arr[0]!=arr[i] for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 143

Multiple choice Sorting And Searching
Sort [10,40,50,30,20,60] in descending order using insertion sort.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 144

Multiple choice Arrays
Which loop throws ArrayIndexOutOfBoundsException…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 145

Multiple choice Arrays
Which code actually adds 5 to every array element? I int[] numbers={1,2,3,4}; for(int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 146

Multiple choice Arrays
The method should return true if target appears anywhere in arr. Which statement is true? public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 147

Multiple choice Arrays
What happens when the code is compiled and run? int[] highTemp={88,92,94,90,88,83} int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 148

Multiple choice Arrays
For a nonempty array, does shiftRight rotate every element one position right, wrapping the last to the first? public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 149

Multiple choice Arrays
For nums={4,4,7,7}, the method from 2558 is repaired by starting i=0 and looping while i<nums.length−1. How many equality tests occur before it returns? public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 150

Multiple choice Arrays
Which loop does NOT print every…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 141 of 1,079
Page 15 of 108