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 101–110 of 145
  1. 101
  2. 102
  3. 103
  4. 104
  5. 105
  6. 106
  7. 107
  8. 108
  9. 109
  10. 110

Question 101

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 102

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 103

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 104

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 105

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 106

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 107

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 108

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 109

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 110

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 101 of 145
Page 11 of 15