91-9990449935 0120-4256464 |
Java Break StatementThe 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: Java Break Statement with LoopExample: Output: 1 2 3 4 Java Break Statement with Inner LoopIt breaks inner loop only if you use break statement inside the inner loop. Example: Output: 1 1 1 2 1 3 2 1 3 1 3 2 3 3 Java Break Statement with SwitchTo understand the example of break with switch statement, please visit here: Java Switch Statement.
Next TopicJava continue statement
|