-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDay_13_switchchallenge.java
More file actions
41 lines (38 loc) · 1.17 KB
/
Day_13_switchchallenge.java
File metadata and controls
41 lines (38 loc) · 1.17 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
37
38
39
40
41
package Programing.Section5;
public class Day_13_switchchallenge {
public static void main(String[] args) {
char character = 'A';
switch(character){
case 'A':
System.out.println("it's A");
break;
case 'B':
System.out.println("it's B");
break;
case 'C':
System.out.println("it's C");
break;
case 'D':
System.out.println("it's D");
break;
case 'E':
System.out.println("it's E");
break;
default:
System.out.println("not found.");
}
System.out.println("");
//using .toLowercase
String month = "November";
switch (month.toLowerCase()){
case "november":
System.out.println("it's a month of November");
break;
case "january":
System.out.println("it's a month of January");
break;
default:
System.out.println("it's not january or november");
}
}
}