Java Programming/Blocks
From Wikibooks, the open-content textbooks collection
Java has a concept called block that is enclosed between the { and } characters, called curly braces. A block executed as a single statetement, and can be used where a single statetement is accepted.
After a block is executed all local variables defined inside the block is discarded, go out of scope.
{
...
// -- This is a block ---
}
Blocks can be nested:
{
...
{
// -- This is a nested block ---
}
}