package com.vaannila.student;
public class MyFor{
public static void main(String argv[]){
int i;
int j;
outer:
for (i=1;i <3;i++)
inner:
for(j=1; j<3; j++) {
if (j==2)
continue outer;
System.out.println("Value for i=" + i + " Value for j=" +j);
}
}
}
I was trying above example from link
http://www.jchq.net/certkey/0202certkey.htm
got output like
Value for i=1 Value for j=1
Value for i=2 Value for j=1
I was trying to understand the output. Any links, ideas, resources,sample code highly appreciated. thanks in advance.
public class MyFor{
public static void main(String argv[]){
int i;
int j;
outer:
for (i=1;i <3;i++)
inner:
for(j=1; j<3; j++) {
if (j==2)
continue outer;
System.out.println("Value for i=" + i + " Value for j=" +j);
}
}
}
I was trying above example from link
http://www.jchq.net/certkey/0202certkey.htm
got output like
Value for i=1 Value for j=1
Value for i=2 Value for j=1
I was trying to understand the output. Any links, ideas, resources,sample code highly appreciated. thanks in advance.