The break Keyword in Java

The break keyword is utilized to stop the whole loop execution. The break word must be utilized inside any loop or a switch construct. The break keyword will stop the execution of the deepest circle and begin executing the following line of code after the ending curly bracket. The syntax for using this keyword is as follows:


Sample Implementation:

public class myTest {

public static void main(string args[]) {

int [] mynumbers = {0, 5, 10, 15, 20};

for(int i : mynumbers ) {

if( i == 15 ) {



System.out.print( i );




This would deliver the accompanying result:0

For any query or issue, feel free to discuss on