Home Segments Top Top Previous Next

134: Mainline

A block is a sequence of statements surrounded by braces. Accordingly, the body of a method is a block, as is any other sequence of statements surrounded by braces.

You see examples of blocks that are not method bodies in Chapter 22, because blocks are used liberally inside Java's if and ifelse statements.