forked from ZeroAccess/CompleteJavaDevelopersCourse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
34 lines (29 loc) · 798 Bytes
/
Copy pathMain.java
File metadata and controls
34 lines (29 loc) · 798 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
34
package Switch;
/**
* Created by robertsg on 11/20/2015.
*/
public class Main {
public static void main(String[] args) {
/*
int value = 3;
if(value ==1) {
System.out.println("Value was 1");
} else if(value == 2) {
System.out.println("Value was 2");
} else {
System.out.println("Value wasn't 1 or 2");
}*/
int switchValue = 1;
switch (switchValue) {
case 1:
System.out.println("Value was 1");
break;
case 2:
System.out.println("Value was 2");
break;
default:
System.out.println("Was not 1 or 2");
break;
}
}
}