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.

Questions 551–560 of 1,079
  1. 551
  2. 552
  3. 553
  4. 554
  5. 555
  6. 556
  7. 557
  8. 558
  9. 559
  10. 560

Question 551

Multiple choice Arraylists
Count empty lockers. All Locker references are nonnull, and isInUse reports whether a locker is occupied. Which replacement for /* missing */ makes the method…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 552

Multiple choice 2D Arrays
Consider the following code segment. int n = // some positive integer int [ ][ ] table = new int[n][n]; // input values into table int sum = 0; for (int row =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 553

Multiple choice 2D Arrays
Consider the following code segment. int m = // some positive integer int n = // some positive integer int [ ][ ] table = new int[m][n]; // input values into…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 554

Multiple choice 2D Arrays
Consider the following incomplete method. public static double findRowSum(double [][] mat, int n) { double sum = 0; // missing code return sum; } Method…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 555

Multiple choice 2D Arrays
Consider the following definition and code segment. int [][] table = new int[5][5]; for (int row = 0; row < table.length-1; row++) for (int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 556

Multiple choice Recursion
What does puzzle(10) return?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 557

Multiple choice Recursion
What happens when mystery(11) is called using Java int arithmetic?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 558

Multiple choice Recursion
What does enigma(9) return?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 559

Multiple choice Recursion
What does printStars(15) print? public void printStars(int n) { if(n==1)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 560

Multiple choice Recursion
What does weird("Hello") return? public String weird(String s) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 551 of 1,079
Page 56 of 108