-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContinue.java
More file actions
30 lines (26 loc) · 817 Bytes
/
Continue.java
File metadata and controls
30 lines (26 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
public class Continue{
public static void main(String[] args){
for(int i=0;i<=5;i++){ //continue in for loop
if(i==3) continue;
System.out.print(i+" ");
}
System.out.println();
int c = 0; //continue in while loop
while(c<=5){
if(c==3){
c++;
continue;
}
System.out.print(c+" ");
c++;
}
System.out.println();
for(int x=1;x<=4;x++){ //continue in nested loop
for(int y=1;y<=4;y++){
if(x==3 && y==2) continue;
System.out.print(x+"."+y+" ");
}
System.out.println();
}
}
}