019-005-003

Exception Propagation: Handling in Method Chains

Medium

Problem Description

In this problem, you will create a program that implements exception propagation through a method call chain (main() → calculate() → parse()), catches the exception at the appropriate level, and displays the result to standard output.

Exception Propagation

When calling methods A→B→C, an error in C propagates back B→A.

Propagation Flow

main() → calculate() → parse()
        ←←← exception propagates ←←←

Learning Points

  • Exceptions propagate to callers in order
  • Can be caught at any level
  • Program terminates if not caught ultimately

Ready to Try Running Code?

Log in to access the code editor and execute your solutions for this problem.

Don't have an account?

Sign Up