-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path_31_continue.java
More file actions
14 lines (14 loc) · 903 Bytes
/
_31_continue.java
File metadata and controls
14 lines (14 loc) · 903 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
public class _31_continue {
public static void main(String[] args) {
for(int i=1; i<=10; i++){
System.out.println(i);
if(i==3) continue; // continue gives control to the next iteration of the loop
// skipping everything that comes after it in the loop it was invoked in
System.out.println("HIHI"); // continue will help the loop skip this line when it's invoked
System.out.println("HAHA"); // continue will help the loop skip this line when it's invoked
System.out.println("HEHE"); // continue will help the loop skip this line when it's invoked
System.out.println("HUIHUI"); // continue will help the loop skip this line when it's invoked
System.out.println("HEH"); // continue will help the loop skip this line when it's invoked
}
}
}