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 31
Multiple choice
Arrays
What does the following code do when executed? int[] highTemp = {88, 92, 94, 90, 88, 83}; int target = 90;…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 32
Multiple choice
Arrays
The method should detect equal adjacent elements. Which changes are needed? I: initialize…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 33
Multiple choice
Arrays
What will print out when the following code executes? int[] nums = {1, 2, 3, 4, 5, 6}; int…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 34
Multiple choice
Arrays
What does the following code snippet output? int[] numbers = {1, 2, 3, 4, 5}; int[] temp = new int[numbers.length]; for (int i = 0;i < numbers.length - 1;i++) {…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 35
Multiple choice
Arrays
What does the following code snippet check for? int[] numbers = {1, 2, 3, 3, 4, 5}; boolean mysteryBoolean = false; for (int i = 0;i…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 36
Multiple choice
Arrays
What does the following code snippet do? int[] scores = {80, 92, 91, 68, 88}; int sum = 0; for (int…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 37
Multiple choice
Arrays
What is the output after this code snippet runs? int[] scores = {80, 92, 91, 68, 88};…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 38
Multiple choice
Arrays
Which of the following code snippets gets the THIRD element in the scores array and assigns it to…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 39
Free response
Arrays
Customers are ordered alphabetically by name, then by positive integer ID when names match. Matching names and IDs identify equal customers. Complete both…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 40
Multiple choice
Arrays
Consider the following code segment. int[] nums = new int[51]; for (int k = 0; k < nums.length; k++) nums[k] = 1; for (int k = 3; k <= 50; k += 3)…
Sign up now. It's free!
See the full question with its answer and worked solution.
Page 4 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.