-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgoto_statement.java
More file actions
33 lines (31 loc) · 887 Bytes
/
goto_statement.java
File metadata and controls
33 lines (31 loc) · 887 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
31
32
33
package src.gotoStatement;
class goto_statement {
public static void main(String[] args) {
boolean x = true;
first: {
second: {
third: {
System.out.println("Before break;");
if(x) break second;
System.out.println("Won't execute");
}
System.out.println("Won't execute");
}
System.out.println("This is after second goto...");
}
}
}
class contiGoto {
public static void main(String[] args) {
outer: for(int i = 0; i < 10; i++) {
for(int j = 0; j < 10; j++) {
if(j > i) {
System.out.println();
continue outer;
}
System.out.print(j + " ");
}
}
System.out.println();
}
}