Skip to content
Sharp

Exceptions · interview question

Why does stack unwinding during exception handling change runtime behavior?

Multiple choiceMediumchapter-6-curatedpremiumexceptionsexceptions-basics
Choose one answer
Answer and explanation

Correct answer

B. It releases resources and cleans up the stack frame of each method.

Why

Stack unwinding involves cleaning up and releasing resources of each method in the call stack as the exception propagates backwards. This allows for proper resource management and prevents memory leaks.

Test yourself on Exceptions

A free test with instant, explained results. No account needed.

Start free test
All Exceptions questions →