-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSwitchCase1.java
More file actions
36 lines (33 loc) · 1.08 KB
/
SwitchCase1.java
File metadata and controls
36 lines (33 loc) · 1.08 KB
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
35
36
public class SwitchCase1 {
public static void main(String[] args) {
int number = -1;
switch (number) {
case 10:
System.out.println("10");
break; //Thoát khỏi vòng switch
case 20:
System.out.println("20");
break;
case 30:
System.out.println("30");
break;
default:
System.out.println("Not in 10, 20 or 30");
}
String browser = "chrome";
switch (browser){
case "chrome":
System.out.println("Chạy test với trình duyệt Chrome.");
break;
case "edge":
System.out.println("Chạy test với trình duyệt MS Edge.");
break;
case "firefox":
System.out.println("Chạy test với trình duyệt Firefox.");
break;
default:
System.out.println("Chạy test với trình duyệt Chrome mặc định.");
break;
}
}
}