# default Java Keyword

The default keyword is used to label the default branch in a switch statement.

## Examples

      int arg = <some value>;
      switch (arg)
      {
         case 1:
            <statements>
            break;
         case 2:
            <statements>
            break;
         default:
            <statements>
            break;
      }

## Remarks

- A default block does not have an implicit ending point. A break statement is typically used at the end of each case or default block to exit the switch statement upon completion of the block.

- Without a default statement, a switch statement whose argument matches no case blocks will do nothing.

Related Topics

break Java Keyword

case Java Keyword

switch Java Keyword