A labeled statement can be used with any type of a block statement.
The following code shows how to use a labeled break Statements:
public class Main { public static void main(String[] args) { blockLabel: {/*from ww w. j av a2 s . c om*/ int i = 10; if (i == 5) { break blockLabel; // Exits the block } if (i == 10) { System.out.println("i is not five"); } } } }