Last Updated: May 22, 2026
A try-catch block is how Java lets a program react to an exception instead of crashing. The risky code goes in try, and a catch clause runs only when something goes wrong. This lesson covers the syntax, the exact way control flows when an exception is thrown, what the exception object offers once it's caught, the scope rules that often surprise on first encounter, and what nested try-catch looks like in practice.