Verityprep
Question Bank

AP® Computer Science A Multiple Choice Questions

Work through AP Computer Science A multiple-choice questions unit by unit, 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 2,351–2,360 of 2,811
  1. 2351
  2. 2352
  3. 2353
  4. 2354
  5. 2355
  6. 2356
  7. 2357
  8. 2358
  9. 2359
  10. 2360

Question 2351

Multiple choice Unit 4: Data Collections
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 2352

Multiple choice Unit 4: Data Collections
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 2353

Multiple choice Unit 4: Data Collections
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 2354

Multiple choice Unit 4: Data Collections
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 2355

Multiple choice Unit 4: Data Collections
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 2356

Multiple choice Unit 4: Data Collections
The method addStars is intended to append "*" at the end of each string in the ArrayList<String> words. Which of the following implementations of addStars will…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2357

Multiple choice Unit 4: Data Collections
Consider the following method: public boolean examine(String[] letters) { int count = 0; for (String letter1 : letters) { for (String letter2 : letters) { if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2358

Multiple choice Unit 4: Data Collections
public class APTestResult { private String subject; private int score; public int getScore() { return score; } // constructor and other methods not shown }…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2359

Multiple choice Unit 4: Data Collections
What is printed when the following code segment is executed? String[] xy = {"X", "Y"};…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2360

Multiple choice Unit 4: Data Collections
Suppose m is a two-dimensional array of size 4 by 4, with all its elements initialized to zeros. The method fill is defined as follows: public void…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,351 of 2,811
Page 236 of 282