Program code in a Java program is contained in a block. A block begins with an open curly brace symbol and ends with a close curly brace symbol. As an example, we might write a block of code that contains a variable definition and some console print statements. To write a block of code, follow these four steps.