🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.OutOfMemoryError
  2. B.NullPointerException
  3. C.StackOverflowError
  4. 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 →