← Back to libraryQuestion 46 of 273
JavaIntermediate

Exception Propagation

📖 Detailed Explanation:

Exception propagation occurs when an exception is thrown in a method but not caught. The exception 'travels' through the call stack to the previous method, continuing until caught or reaching main(), where it terminates the thread. Checked exceptions must be explicitly thrown in method signatures; unchecked exceptions propagate automatically.

🌍 Real-World Example:

A ball is thrown down a staircase. It bounces down step-by-step until someone catches it or it reaches the bottom.

🎯 Scenario-Based Interview Question:

If an exception is thrown in a 'finally' block, what happens to the original exception?