Simple Example for Continue Lable in Java


Couch ModePrint

Simple Example for  Continue Lable in JAVA

class continueex
{
 public static void main(String arg[])
 {
 lable1:for(int i=0;i<10;i++)
 {
 if(i%2==0)
 {
 System.out.println("Even Value:"+i);
 continue lable1;
 }
 System.out.println("Odd Value:"+i);
 }
 }
 }

Output

Even Value:0
Odd Value:1
Even Value:2
Odd Value:3
Even Value:4
Odd Value:5
Even Value:6
Odd Value:7
Even Value:8
Odd Value:9

Thank Your Valuable Comment Tool to Insert codes in Comments : Convert My Code. Hide

Select to parse the code (not required if code is already parsed):

Subscribe By Email

Join Our Newsletter

Get All The Latest Updates Delivered Straight Into Your Inbox For Free!

We Respect Your Privacy

Popular Posts