CHAPTER 14: Blocks and Statements Previous
Previous
Java Language
Java Language
Index
Index
Next
Next

14.2 Blocks

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


Block:

	{ BlockStatementsopt }

BlockStatements:

	BlockStatement

	BlockStatements BlockStatement

BlockStatement:

	LocalVariableDeclarationStatement

	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.

© 1996 Sun Microsystems, Inc. All rights reserved.