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.

Subtopic: Recursion Clear filter

Questions 71–80 of 140
  1. 71
  2. 72
  3. 73
  4. 74
  5. 75
  6. 76
  7. 77
  8. 78
  9. 79
  10. 80

Question 71

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 72

Multiple choice Recursion
Refer to the following method. public static int mystery(int n) { if (n == 1)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 73

Multiple choice Recursion
Consider the following method. public int mystery(int n) { if (n == 0) return 0; else if (n % 2…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 74

Multiple choice Recursion
When will method whatIsIt cause a stack overflow (i.e., cause computer memory to be exhausted)?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 75

Multiple choice Recursion
Consider the following method. public static void whatsIt(int n) { if (n > 10) { whatsIt(n /…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 76

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 77

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 78

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 79

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 80

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 71 of 140
Page 8 of 14