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 61–70 of 145
  1. 61
  2. 62
  3. 63
  4. 64
  5. 65
  6. 66
  7. 67
  8. 68
  9. 69
  10. 70

Question 61

Multiple choice 2D Arrays
This question is based on the Point class below. public class Point { /** The coordinates. */ private int x; private int y; public Point (int xValue, int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 62

Multiple choice 2D Arrays
A Tic-Tac-Toe board contains X, O or a blank. Each row of its string representation starts and ends with a vertical bar, with no internal separators, followed…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 63

Multiple choice 2D Arrays
Suppose that grid has been initialized as n-by-n 2-D array of integers.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 64

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 65

Multiple choice 2D Arrays
Consider the following code segment. int [] [] a = new int [5] [5]; for (int r = 0;r < a.length;r++) for (int c = r + 1;c < a[0].length;c++) a[r][c] = 9; for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 66

Multiple choice 2D Arrays
Consider the following code segment. int [] [] table = new int [5] [6]; int val = 0; for (int k = 0;k < table[0].length;k++) { for (int j…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 67

Multiple choice 2D Arrays
Consider the following output. A A A A P P P P C C C C Which of the following code segments will produce this output? I. String[] letters = {"A", "P", "C",…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 68

Multiple choice 2D Arrays
Consider the following code segment. int [] [] matrix = new int [3] [3]; int value = 0; for (int row = 0;row < matrix.length;row++) { for (int column = 0;column…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 69

Multiple choice 2D Arrays
Consider the following code segment. int [] [] grid = { {0, 1, 2}, {3, 4, 5}, {6, 7, 8}, {9, 10, 11} }; int [] [] newGrid = new int [grid[0].length]…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 70

Multiple choice 2D Arrays
Consider the following code segment. int[][] grid = new int[3][3]; for (int row = 0;row < grid.length;row++) { for (int col = 0;col <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 61 of 145
Page 7 of 15