Blocks

class Demo {
     public static void main(String[] args) {
          boolean condition = true;
          if (condition) { // begin block 1
               System.out.println("Condition is true.");
          } // end block one
          else { // begin block 2
               System.out.println("Condition is false.");
          } // end block 2
     }
}

Is a group of zero or more statements between balanced braces and can be used anywhere a single statement is allowed.

Blocks — Structure map

Clickable & Draggable!

Blocks — Related pages: