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.

Questions 851–860 of 1,222
  1. 851
  2. 852
  3. 853
  4. 854
  5. 855
  6. 856
  7. 857
  8. 858
  9. 859
  10. 860

Question 851

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 852

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 853

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 854

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 855

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 856

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 857

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 858

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 859

Multiple choice Recursion
What does mystery(3543) return? public int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 860

Multiple choice Recursion
What does mystery(6) return? public int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 851 of 1,222
Page 86 of 123