The Java® Language Specification, Java SE 7 Edition, Fourth Edition
by James Gosling, Bill Joy, Guy Steele, Gilad Bracha, Alex Buckley
14.20. The try statement
A try statement executes a block. If a value is thrown and the try statement has one or more catch clauses that can catch it, then control will be transferred to the first such catch clause. If the try statement has a finally clause, then another block of code is executed, no matter whether the try block completes normally or abruptly, and no matter whether a catch clause is first given control.
TryStatement: try Block Catches try Block Catchesopt Finally TryWithResourcesStatementCatches: CatchClause Catches CatchClauseCatchClause: catch ( CatchFormalParameter ) BlockCatchFormalParameter: VariableModifiersopt CatchType VariableDeclaratorIdCatchType: ClassType ClassType | CatchTypeFinally: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access