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.

Subtopic: Arrays Clear filter

Questions 221–230 of 341
  1. 221
  2. 222
  3. 223
  4. 224
  5. 225
  6. 226
  7. 227
  8. 228
  9. 229
  10. 230

Question 221

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 222

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 223

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 224

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 225

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 226

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 227

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 228

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 229

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 230

Multiple choice Arrays
Consider the following method: public int mysteryCount(int[] p) { int count = 0; for (int i = 0; i < p.length; i++) { count++; int j…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 221 of 341
Page 23 of 35