Verityprep
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.

Questions 651–660 of 1,222
  1. 651
  2. 652
  3. 653
  4. 654
  5. 655
  6. 656
  7. 657
  8. 658
  9. 659
  10. 660

Question 651

Multiple choice Arraylists
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.

Question 653

Multiple choice 2D Arrays
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.

Question 656

Multiple choice Arraylists
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.

Question 658

Multiple choice Recursion
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.

Question 659

Multiple choice Recursion
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.

Question 660

Multiple choice Arraylists
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.

Question 651 of 1,222
Page 66 of 123