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
A class Turtle has a void method forward(int d) that moves the turtle forward by d units. A class TurtleRace has a list of Turtle objects: private…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 652
Multiple choice
Arrays
If the classes House and HouseForSale compile with no errors,…
Sign up now. It's free!
See the full question with its answer and worked solution.
Which of the following code segments correctly…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 654
Free response
Arrays
All emails received by the Office of Complaints in Appaloosa County are assigned a priority rank from 0 to 9 and answered in order of priority; emails of higher…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 655
Free response
2D Arrays
In a traffic modeling application, a segment of a highway is represented as a two-dimensional array of integers, in which each row represents one lane and each…
Sign up now. It's free!
See the full question with its answer and worked solution.
Consider the following method intended to remove all elements with a value less than zero from an ArrayList<Integer>: public void…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 657
Multiple choice
Arrays
Consider the following code segment: int[] arr = {1, 2, 3, 4, 5, 6, 7, 8}; for (int k = 1; k <= 6; k += 2) { arr[7] = arr[k]; arr[k]…
Sign up now. It's free!
See the full question with its answer and worked solution.
Consider the following recursive method: public static void smile(int n) { if (n == 0) { return; } for (int…
Sign up now. It's free!
See the full question with its answer and worked solution.
Consider the following recursive method: public static void smile(int n) { if (n == 0) { return; } for (int k = 1; k <= n; k++) {…
Sign up now. It's free!
See the full question with its answer and worked solution.
Consider the following incomplete method, which shuffles a list of Card objects so that any card can end up at any index in the list deck, with equal…
Sign up now. It's free!
See the full question with its answer and worked solution.
Page 66 of 123
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.