-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSwitchCaseDemo.java
More file actions
28 lines (25 loc) · 653 Bytes
/
SwitchCaseDemo.java
File metadata and controls
28 lines (25 loc) · 653 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
package JavaCodes;
class SwitchCaseDemo {
public static void main(String args[]) {
// switch allowed char , int , byte
// From Java 7 String is allowed in switch case
/*
* final int SUNDAY = 1; // Constants final int MONDAY = 2; final int
* TUESDAY = 3; int days = SUNDAY;
*/
String days = "Sunday";
switch (days) {
default:
System.out.println("Wrong Day....");
break;
case "Sunday":
System.out.println("This is Funny Day ....");
break;
case "Monday":
System.out.println("This is Such a Boring Day Lot of Work ....");
break;
case "Tuesday":
System.out.println("This is Little Bit Boring...");
}
}
}