Blocks and Scope in Java Programming

Blocks and Scope in Java Programming

Previous Home Next

 

A block is a compound statement and consists of all statements between the opening and closing braces.

 
 A block is a compound statement and consists of all the statements between an opening and closing brace.
Variables defined inside a block have block scope. Variables defined within a block have block scope and are visible within the block; they are not visible outside the block.
 


 

Previous Home Next