O'Reilly logo

The Java® Language Specification, Java SE 7 Edition, Fourth Edition by Alex Buckley, Gilad Bracha, Guy Steele, Bill Joy, James Gosling

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required