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: 2D Arrays Clear filter

Questions 31–40 of 195
  1. 31
  2. 32
  3. 33
  4. 34
  5. 35
  6. 36
  7. 37
  8. 38
  9. 39
  10. 40

Question 31

Multiple choice 2D Arrays
Consider the following code segment: String[][] word = {{"DOE", "A", "DEER"}, {"A", "FEMALE", "DEER"}, {"RAY", "A", "DROP"}, {"OF", "GOLDEN", "SUN"}}; int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 32

Multiple choice 2D Arrays
Consider the following code segment: int[][] arr = {{10, 9, 8}, {7, 6, 5}, {4, 3, 2}}; for (int row = 0;row < arr.length;row++) { for (int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 33

Multiple choice 2D Arrays
Consider the following method, sumTo10, that traverses a 2D array checking to see if the sum of all integers in each array are equal to 10. The method will…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 34

Multiple choice 2D Arrays
Which of the following traversals would print all of the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 35

Multiple choice 2D Arrays
Which of the following traversals would print all of the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 36

Multiple choice 2D Arrays
Consider the following code segment: int[][] nums = {{1, 2, 3}, {100, 200, 300}, {4, 6, 5}, {7, 8, 6}}; int sum = 0; for (int row = 0;row < nums.length /…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 37

Multiple choice 2D Arrays
Consider the following code segment: int[][] mystery = new int[3][3]; int counter = 0; while (counter < mystery.length) { for (int col = 0;col <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 38

Multiple choice 2D Arrays
What is the proper syntax to…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 39

Multiple choice 2D Arrays
int[][] grid = new int[5][3];…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 40

Multiple choice 2D Arrays
A 2D array is initialized: int [][] array = {{1, 2, 3}, {4, 5,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 31 of 195
Page 4 of 20