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 331
Multiple choice
Arrays
Which initializes an int array with four zero elements? I: int[] arr={0,0,0,0};…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 332
Multiple choice
Arrays
Assume location has been declared. The segment should locate the first negative…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 333
Multiple choice
Arrays
What occurs for a nonempty int…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 334
Multiple choice
Arrays
arr1 initially contains [0,6,0,4,0,0,2]. What does…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 335
Multiple choice
Arrays
Assume k≥2 and arr.length>k. What is the maximum…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 336
Multiple choice
Arrays
What will be output from the following code segment, assuming it is in the same class as the doSomething method? int[] arr = {1, 2, 3, 4}; doSomething(arr);…
Sign up now. It's free!
See the full question with its answer and worked solution.
A program reads an unknown number of text-file…
Sign up now. It's free!
See the full question with its answer and worked solution.
For intensive calculations over a fixed-size list of numeric values,…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 339
Multiple choice
Arrays
Assume every list element is a nonnull Address. Which statement in the enhanced loop prints each name? public class Address { private String…
Sign up now. It's free!
See the full question with its answer and worked solution.
Question 340
Multiple choice
Arrays
Every element of Address[] list is nonnull. Address has no overridden toString. Which replacement prints each full mailing address using the accessors? I uses…
Sign up now. It's free!
See the full question with its answer and worked solution.
Page 34 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.