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 861–870 of 1,222
  1. 861
  2. 862
  3. 863
  4. 864
  5. 865
  6. 866
  7. 867
  8. 868
  9. 869
  10. 870

Question 861

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 862

Multiple choice Recursion
Which recursive definitions match a loop that sums integers x through 1, for every x >= 0? Assume no integer overflow. // I:…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 863

Multiple choice Recursion
What does mystery(30,18) return? public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 864

Multiple choice Recursion
Which replacement makes mystery(10)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 865

Multiple choice Arrays
What is printed? int result=0;int[] a={1,2,3,4,5} for(int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 866

Multiple choice Arrays
What are the final array contents?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 867

Multiple choice Arrays
What is count after the loop? int[]…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 868

Multiple choice Arrays
What are the final array and sum? int[]…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 869

Multiple choice Arrays
For a nonempty array, what does this method return? public int mystery(int[] a){ int m=-1,index=0; for(int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 870

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 861 of 1,222
Page 87 of 123