-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmonth.java
More file actions
37 lines (36 loc) · 1.08 KB
/
month.java
File metadata and controls
37 lines (36 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
37
package project;
public class month {
public static void main(String[] args) {
int m = 10;
String month;
switch (m) {
case 1: month = "January";
break;
case 2: month = "February";
break;
case 3: month = "March";
break;
case 4: month = "April";
break;
case 5: month = "May";
break;
case 6: month = "June";
break;
case 7: month = "July";
break;
case 8: month = "August";
break;
case 9: month = "September";
break;
case 10: month = "October";
break;
case 11: month = "November";
break;
case 12: month = "December";
break;
default: month = "Invalid month";
break;
}
System.out.println(month);
}
}