example code to Demonstrate Break and Continue
// example code to Demonstrate Break and Continue
package flowcontrol;
public class BreakAndContinue {
public static void main(String[] args) {
int no=10;
int i=1,j;
for(i=1;i<10;i++)
{
if ( (i %2 ) == 0)
continue; // 1 , 3 , 5 , 7 , 9
// break; // 1
System.out.print(i);
}
}
}
0 comments:
Post a Comment