next up previous
Next: if statement Up: Statements Previous: Local variable declarations

Compound statements

Compound statements are statements that contain a statement block enclosed in {} braces. All compound statements follow the same braces style; namely, the style commonly known as the "K & R" braces style. This includes class and method declarations. This style is specified as follows:
  1. The opening left brace is at the end of the line beginning the compound statement. For multiple-line compound statements, the opening curly brace shall appear alone by itself on a new line.
  2. The closing right brace is alone on a line, indented to the same column as the beginning of the compound statement.
  3. The statements inside the enclosed braces are indented one more level than the compound statement.
The rules on how to format particular statements are described below.

Subsections

Dennis Seah Mon Jul 17 11:43:42 2006