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 131–140 of 195
  1. 131
  2. 132
  3. 133
  4. 134
  5. 135
  6. 136
  7. 137
  8. 138
  9. 139
  10. 140

Question 131

Multiple choice 2D Arrays
The following class, Arr2d, is meant to represent a two-dimensional array object. The constructor will initialize Arr2d using the number of rows and columns…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 132

Multiple choice 2D Arrays
Which output layout results? int[][] numbers={{1,2,3,4},{5,6,7,8}}; for(int[]…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 133

Multiple choice 2D Arrays
Consider the following code segment: int[][] numbers = new int [4][4]; initializeIt(numbers); int total = 0; for (int z = 0; z < numbers.length; z++) { total +=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 134

Multiple choice 2D Arrays
Consider the following code segment: int[][] numbers = new int[3][6]; initializeIt(numbers); int total = 0; for (int j = 0; j < numbers.length; j++) { for (int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 135

Multiple choice 2D Arrays
Consider the following code segment: int[][] num = new int[4][4]; for (int i = 0; i < num.length; i++) { for (int k =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 136

Multiple choice 2D Arrays
Consider the following code segment: int [][] numbers = {{1, 2, 3, 4},{5, 6, 7, 8}}; initializeIt(numbers); String line = ""; for (int a = 0; a <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 137

Multiple choice 2D Arrays
Consider the following client code and method: int [][] numbers = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}}; int [] myArr = mystery(numbers, 2); for (int j:…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 138

Multiple choice 2D Arrays
Consider the following code: int [][] numbers = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}}; for (int r = numbers.length - 1; r > 0 ; r--) { for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 139

Multiple choice 2D Arrays
Consider the following 2D array: int[][] matrix = new int[3][4]; int count = 0; for (int i = 0;i < matrix.length;i++) { for (int j =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 140

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 131 of 195
Page 14 of 20