CODE
class CodeBlock
{
public static void main(String arg[])
{
System.out.println("In main block");
{ // LINE A
System.out.print("In ");
System.out.print("inner ");
System.out.print("block "); // LINE A1
System.out.println("One");
}
{ // LINE B
System.out.print("In ");
System.out.print("inner ");
System.out.print("block ");
System.out.println("Two");
{ // LINE C
System.out.println ("Block inside inner block two");
}
} // LINE D
}
}
In main block
In inner block One
In inner block Two
Block inside inner block two
Here we have two inner blocks starting at LINE A and LINE B. Inside the second inner block we have one more block starting at LINE C. The class content and the main method content are also blocks. In total there are 5 blocks in this program.