In Java, a block is represented by beginning and curly brackets. So far, we have seen
main method and
if condition have blocks. (We will discuss classes in later modules.)
Each block has its own variable scope, that is, a variable declared within a block is accessible only within that block, and not outside of it.
Variables that are already in-scope when the block starts, they remain in-scope. But variables that are declared within the block will go out-of-scope at the end of the block.