Our Best Offer Ever!! Summer Special - Get 3 Courses at 24,999/- Only. Read more
Hire Talent (HR):+91-9791 444 054

General

Continue Statement in Java

Continue Statement in Java

Continue Statement in Java

Continue key word will skip the remaining code in the loop and it will move to conditional statement for the next iteration.Continue will skip only the particular iteration remaining block of code in the loop but break will terminate the entire loop statement.

Example:

Public class Test{
Public static void main(String[] args){
For(int i=1;i<=10;i++){
If(i%2==0){
Continue;
}else{
System.out.println(i);
}
}
}
}

Output:

1
3
5
7
9

Click Here-> Get Java Training with Real-time Projects

Besant Technologies WhatsApp