A BREAK statement in Java causes the program control to exit the block or loop immediately.
A Java Label is any valid Identifier or name with a COLON after it.
Rules to define a Label
- A Label name must start with either Alphabet, Number, Underscore(_) or a Dollar ($) symbol.
- A Label must be followed by a Loop or a Block.
- Defining a Label like a Goto statement produces a compiler error
There are two types of Break statements.