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 221
Multiple choice
Arrays
What is the result when the following code segment is executed? Object[] nums = {null, null, null}; nums[0] = new…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 222
Multiple choice
Arrays
Consider the following code segment, intended to find the position of an integer targetValue in int[] a.…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 223
Multiple choice
Arrays
Consider the following two implementations of the method getValue(double[] c, int n, double x) that computes and returns the value of…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 224
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.
Question 225
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 226
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.
Question 227
Multiple choice
Arrays
Consider the following method: public boolean examine(String[] letters) { int count = 0; for (String letter1 : letters) { for (String letter2 : letters) { if…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 228
Multiple choice
Arrays
What is printed when the following code segment is executed? String[] xy = {"X", "Y"};…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 229
Multiple choice
Arrays
Consider the following code segment. int[] nums = new int[8]; nums[0] = 0; int n = 1; while (n < nums.length) { int k; for (k = n; k < 2 *…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 230
Multiple choice
Arrays
Consider the following method: public int mysteryCount(int[] p) { int count = 0; for (int i = 0; i < p.length; i++) { count++; int j…
Sign up now. It's free!
See the full question with its answer and worked solution.
Page 23 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.