Java Tutorial

What is Java


Control Statements


Java Object Class


Java Inheritance


Java Polymorphism


Java Abstraction


Java Encapsulation


Java Array

Java OOPs Misc


Java Break Statement

The Java break is used to break loop or switch statement. It breaks the current flow of the program at specified condition. In case of inner loop, it breaks only inner loop.

Syntax:

Flash Soon


Java Break Statement with Loop

Example:

Flash Soon


Output:

Java Break Statement with Inner Loop

It breaks inner loop only if you use break statement inside the inner loop.

Example:

Flash Soon


Output:

Java Break Statement with Switch

To understand the example of break with switch statement, please visit here: Java Switch Statement.

Advertisement

Copyright ©2017 Design& develop