← Quiz: JVM Memory and Garbage Collection: all 10 questions
Quiz: JVM Memory and Garbage Collection · Question 2 of 10
Which error is thrown when recursion never reaches a base case?
Which error is thrown when recursion never reaches a base case?
- A.OutOfMemoryError
- B.NullPointerException
- C.StackOverflowError
- D.IllegalStateException
Answer & explanation
Correct answer: StackOverflowError
Each call adds a frame to the thread's fixed-size stack; without a base case, the stack runs out.
Can you get the rest right without peeking?
Take the timed Quiz: JVM Memory and Garbage Collection quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →