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

Questions 111–120 of 145
  1. 111
  2. 112
  3. 113
  4. 114
  5. 115
  6. 116
  7. 117
  8. 118
  9. 119
  10. 120

Question 111

Multiple choice 2D Arrays
Consider the following 2D array: int[][] matrix = { {1, 2,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 112

Multiple choice 2D Arrays
Consider the following code segment. int[][] arr2D = /* missing initialization */; int sum = 0; for (int j = 0; j < arr2D.length; j++) { sum +=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 113

Multiple choice 2D Arrays
Consider the following code segment. int[][] arr = {{10, -7, 19, 14}, {-3, -2, -6, 11}, {-9, 12, 10, -1}}; int ans = 1; for (int[] row : arr) { for (int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 114

Multiple choice 2D Arrays
What is the value of sum after the following executes? int[][] grid = { {1, 2, 3}, {4, 5,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 115

Multiple choice 2D Arrays
What does the following method return for input [[1,2],[3,4],[5,6]]? public static int colSum(int[][] m, int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 116

Multiple choice 2D Arrays
Consider the following code that processes a 2D array: int[][] g = {{1,2,3},{4,5,6},{7,8,9}}; int total = 0; for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 117

Multiple choice 2D Arrays
A method receives a 2D integer array and returns true…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 118

Multiple choice 2D Arrays
A method receives a 2D array int[][] m where all rows have…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 119

Multiple choice 2D Arrays
What is printed? int[][] m = {{2,7,6}, {9,5,1}, {4,3,8}}; int sum = 0; for (int i = 0;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 120

Multiple choice 2D Arrays
This code finds the maximum value in each column and sums them. What is printed? int[][] grid = {{1,2,3,4}, {5,6,7,8}, {9,10,11,12}}; int result = 0; for (int c…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 111 of 145
Page 12 of 15