Concept Flow - Try–catch block
Start
Try block begins
Code runs
Exception thrown?
No→Try block ends normally
|Yes
Catch block matches exception
Catch block runs
Continue after catch
End
The program tries code inside the try block. If an error (exception) happens, it jumps to the matching catch block to handle it, then continues.