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.
All 1,222
Multiple choice 1,079
Free response 143
Subtopic: Arrays
Clear filter
Question 51
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 52
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 53
Multiple choice
Arrays
Which loop throws ArrayIndexOutOfBoundsException…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 54
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 55
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 56
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 57
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 58
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 59
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 60
Multiple choice
Arrays
Which initializes a boolean array of three elements all containing true? I: boolean[] arr={true, true,…
Sign up now. It's free!
See the full question with its answer and worked solution.
Page 6 of 35
Get your FRQs graded in the Student Portal
In the Verityprep Student Portal, answer the FRQs of AP practice and past exams by typing or uploading a photo. A teacher grades them with that year's official College Board scoring guidelines and gives you an estimated 1–5 score.
Join Verityprep now
AP® and Advanced Placement® are registered trademarks of the College Board, which is not affiliated with, and does not endorse, Verityprep. Names are used for identification purposes only.