14.2. Blocks

A block is a sequence of statements, local class declarations, and local variable declaration statements within braces.

Block:    { BlockStatementsopt }BlockStatements:    BlockStatement    BlockStatements BlockStatementBlockStatement:    LocalVariableDeclarationStatement    ClassDeclaration    Statement

A block is executed by executing each of the local variable declaration statements and other statements in order from first to last (left to right). If all of these block statements complete normally, then the block completes normally. If any of these block statements complete abruptly for any reason, then the block completes abruptly for the same reason.

Get The Java® Language Specification, Java SE 7 Edition, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.