forked from natural/java2python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIf0.java
More file actions
26 lines (22 loc) · 452 Bytes
/
If0.java
File metadata and controls
26 lines (22 loc) · 452 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
class If0 {
public static void main(String[] args) {
int x = 0;
if (x == 0) {
System.out.println(0);
}
if (x == 0) {
System.out.println(1);
} else {
System.out.println("fail");
}
if (x == 0) {
System.out.println(2);
} else if (x == 1) {
System.out.println("catastrophe");
} else if (x == 2) {
System.out.println("error");
} else {
System.out.println("disaster");
}
}
}