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 461–470 of 1,079
  1. 461
  2. 462
  3. 463
  4. 464
  5. 465
  6. 466
  7. 467
  8. 468
  9. 469
  10. 470

Question 461

Multiple choice Arrays
Consider the following instance variable and method findLongest with line numbers added for reference. Method findLongest is intended to find the longest…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 462

Multiple choice Arrays
Consider the following instance variable and method findLongest with line numbers added for reference. Method findLongest is intended to find the longest…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 463

Multiple choice Arrays
Consider the following instance variable and method. private int[] myStuff; /** Precondition: myStuff contains int values in no particular order. */ public int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 464

Multiple choice Recursion
Consider the following method. / * * @param x x >= 0 * / public void mystery(int x) { System.out.print(x % 10); if ((x / 10)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 465

Multiple choice Recursion
Consider the following recursive method. public static int mystery(int n) { if (n == 0) return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 466

Multiple choice Arrays
Consider the following instance variable and method. private int[] arr; /** Precondition: arr.length > 0 */ public int checkArray() { int loc = arr.length /…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 467

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 468

Multiple choice Arraylists
Consider the following methods. public List<Integer> process1(int n) { List<Integer> someList = new ArrayList<Integer>(); for (int k = 0; k < n; k++)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 469

Multiple choice Arrays
Consider the following instance variable and incomplete method, partialSum, which is intended to return an integer array sum such that for all i, sum[i] is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 470

Multiple choice Arraylists
What is printed? Assume java.util.ArrayList has been imported. public class Java1102 { public static void main(String[] args) { ArrayList names=new…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 461 of 1,079
Page 47 of 108