Home >>Java Programs >Break statement in Java
In this example, we will see a Java program in which we will see the break statement in java.
break statement is used to interrupts the flow of loop at certain conditions and break the execution of any loop or to break the switch cases in the switch statements.
Program:
public class Main
{
public static void main(String arg[])
{
int i;
for(i=1;i<=20;i++)
{
if(i==13)
{
break;
}
System.out.println(i);
}
}
}