In this tutorial, we will learn about Jumping statements in Java. Jumping statements are also part of control statements in Java. Jumping statements are used to send execution control to a specific statement in Java. Here we will learn three jumping statements in Java.
- break
- continue
- return
break statement: Break statement is used to break the normal flow of execution control. we use break statement normally with switch statements in cases and in loops to break loop based on the specific condition. Always keep in mind we can not use break statement outside the loop or switch statement.
class BreakExample
{
public static void main(String[] args){
for(int i=0; i<10; i++){
if(i==5){
break;
}
System.out.println(i);
}
System.out.println("outside of for loop");
}
}
continue statement: Continue statement with loops. It is so simple when continue statement encountered it simply skip the current iteration of the loop and move to the next iteration. If there is any other statement after continue statement that will not execute. Check this example.
class ContinueExample
{
public static void main(String[] args){
for(int i=1; i<=10; i++){
if(i==5||i==7){
continue;
}
System.out.println(i);
}
}
}
return statement: Return statement we use with methods in java. The main motive of the return statement is to return value to its caller. Check this example.
class ReturnExample
{
public static void main(String[] args){
int result = new ReturnExample().sum(10,15);
System.out.println("Result is = "+result);
}
int sum(int a,int b){
return a+b;
}
}

Parvesh Sandila is a passionate web and Mobile app developer from Jalandhar, Punjab, who has over six years of experience. Holding a Master’s degree in Computer Applications (2017), he has also mentored over 100 students in coding. In 2019, Parvesh founded Owlbuddy.com, a platform that provides free, high-quality programming tutorials in languages like Java, Python, Kotlin, PHP, and Android. His mission is to make tech education accessible to all aspiring developers.​