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
Question 91
Multiple choice
Arrays
What value will be held in mysteryNumber when this code finishes running? int mysteryNumber = 0; String[] mysteryArray =…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 92
Multiple choice
Arrays
What will the Array gameBoard contain after this code runs? int WIDTH = 3; int HEIGHT = 3; String[] gameBoard = new String[WIDTH * HEIGHT]; for(int m = 0; m <…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 93
Multiple choice
Arrays
Given the following values of arr and the mystery method, what will the values of arr be after you execute: mystery()? private…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 94
Multiple choice
Arrays
The following codes are intended to add 5 to each item in the array. I. int[] numbers = {1, 2, 3, 4}; for (int i = 0;i <…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 95
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 96
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 97
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 98
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 99
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 100
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.
Page 10 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.