Java new switch code example
Example 1: java switch
int day = 4;
switch (day) {
case 6:
System.out.println("Today is Saturday");
break;
case 7:
System.out.println("Today is Sunday");
break;
default:
System.out.println("Looking forward to the Weekend");
}
Example 2: java switch case
switch(x){
case(0):
break;
default:
break;
}
Example 3: switch statement in java
switch(expression)
{
case 1 value :
break;
case 2 value :
break;
case 3 value :
break;
.
.
.
.
default:
}
Example 4: switch en java
switch ()
{
case :
;
break;
default:
;
}