-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSwitchCase2.java
More file actions
21 lines (19 loc) · 866 Bytes
/
SwitchCase2.java
File metadata and controls
21 lines (19 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
public class SwitchCase2 {
public static void main(String[] args) {
String browser = " Firefox ";
//Hàm toLowerCase() dùng chuyển chuỗi về chữ thường
//Hàm toUpperCase() dùng chuyển chuỗi về chữ in hoa
//Hàm trim() dùng để cắt bỏ khoảng trắng 2 đầu của chuỗi
switch (browser.toLowerCase().trim()){
case "chrome":
System.out.println("Chạy test với trình duyệt Chrome.");
case "edge":
System.out.println("Chạy test với trình duyệt MS Edge.");
case "firefox":
System.out.println("Chạy test với trình duyệt Firefox.");
default:
System.out.println("Chạy test với trình duyệt Chrome mặc định.");
break;
}
}
}