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.

Subtopic: Arrays Clear filter

Questions 211–220 of 300
  1. 211
  2. 212
  3. 213
  4. 214
  5. 215
  6. 216
  7. 217
  8. 218
  9. 219
  10. 220

Question 211

Multiple choice Arrays
Consider the following method: public int countSomething(int[] arr) { int m = arr[0]; int count = 1; for (int k = 1; k < arr.length; k++) { int a =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 212

Multiple choice Arrays
Consider the following method: public void change(double[] nums, int n) { for (int k = 0; k < n; k++) { nums[k] = 5.4; } n = 2; } What will be stored…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 213

Multiple choice Arrays
What is the result when the following code segment is executed? Object[] nums = {null, null, null}; nums[0] = new…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 214

Multiple choice Arrays
Consider the following code segment, intended to find the position of an integer targetValue in int[] a.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 215

Multiple choice Arrays
Consider the following two implementations of the method getValue(double[] c, int n, double x) that computes and returns the value of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 216

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 217

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 218

Multiple choice Arrays
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 219

Multiple choice Arrays
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 220

Multiple choice Arrays
Consider the following code segment. int[] nums = new int[8]; nums[0] = 0; int n = 1; while (n < nums.length) { int k; for (k = n; k < 2 *…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 211 of 300
Page 22 of 30