🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Recursion and Stack Frames: all 10 questions

Quiz: Recursion and Stack Frames · Question 7 of 10

What usually happens when recursion has no reachable base case?

What usually happens when recursion has no reachable base case?

  1. A.The compiler adds one automatically
  2. B.The function returns 0
  3. C.Frames keep being pushed until the stack runs out — a stack overflow crash
  4. D.The program runs forever without using memory
Answer & explanation

Correct answer: Frames keep being pushed until the stack runs out — a stack overflow crash

Each call takes stack space, and the stack is limited.

Can you get the rest right without peeking?

Take the timed Quiz: Recursion and Stack Frames quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →