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 291–300 of 341
  1. 291
  2. 292
  3. 293
  4. 294
  5. 295
  6. 296
  7. 297
  8. 298
  9. 299
  10. 300

Question 291

Multiple choice Arrays
int[] arr = new int[3];…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 292

Multiple choice Arrays
int[] arr = null;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 293

Multiple choice Arrays
int[] arr = new int[3];…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 294

Multiple choice Arrays
Integer[] arr = new Integer[3];…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 295

Multiple choice Arrays
String[] arr = new String[3];…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 296

Multiple choice Arrays
String[] arr = null; if (arr == null) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 297

Multiple choice Arrays
public static int countNull(String[] arr) { int count = 0; for (int i = 0;i < arr.length;i++) { if (arr[i] == null) { count++; } } return count; } String[]…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 298

Multiple choice Arrays
Consider the following method: public static int countWordNull(String[] arr) { int count = 0; for (int i = 0; i < arr.length; i++) { if (arr[i].equals("null"))…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 299

Multiple choice Arrays
public static int countSpecial(String[] arr) { int count = 0; for (int i = 0;i < arr.length;i++) { if (arr[i] == null || arr[i].equals("")) { count++; } }…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 300

Free response Arrays
This question involves the design of a class that maintains a collection of tasks. The following Task class is provided. public class Task { private String…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 291 of 341
Page 30 of 35