Verityprep
Question Bank · Unit 4

AP® Computer Science A Data Collections Multiple Choice Questions

Work through AP Computer Science A multiple-choice 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 581–590 of 1,079
  1. 581
  2. 582
  3. 583
  4. 584
  5. 585
  6. 586
  7. 587
  8. 588
  9. 589
  10. 590

Question 581

Multiple choice Arraylists
What is printed when the code segment is executed? ArrayList<Integer> lst = new ArrayList<Integer>(); int k = 2; while (lst.size() <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 582

Multiple choice Arrays
Consider the following three implementations of a method rotate90Degrees and the code segments used to test them. I. public int[] rotate90Degrees(int[] v) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 583

Multiple choice Arrays
String[] a = {"A", "B"}; String[] b = a; String[] c = {a[0], a[1]}; String letter = a[0]; a[0] = a[1]; a[1] =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 584

Multiple choice Arrays
What is the value of v[4] after the following code segment is executed? int d = 1;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 585

Multiple choice Recursion
Consider the following method. public void splat(String s) { if (s.length() < 8)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 586

Multiple choice Recursion
Consider the following method. public void printVals(String[] items, int k) { if (k > 1) { printVals(items, k - 1); System.out.print(items[k] + " ");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 587

Multiple choice Recursion
Consider the following method. public void printVals(String[] items, int k) { if (k > 1) { printVals(items, k - 1); System.out.print(items[k] + " ");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 588

Multiple choice Arraylists
Consider the following classes Point and Polygon. public class Point { private int x, y; public Point(int _x, int _y) { x = _x; y = _y; } public int getX() {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 589

Multiple choice Arraylists
Consider the following classes Point and Polygon. public class Point { private int x, y; public Point(int _x, int _y) { x = _x; y = _y; } public int getX() {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 590

Multiple choice Arrays
Consider the following code segment. int[] factors = {2, 3, 4, 7, 2, 5}; int product = 1; for (int i = 1; i <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 581 of 1,079
Page 59 of 108