R4R Java SourceCode SWITCH

SWITCH

In This example we will learn how we can use switch is java.

SOURCE CODE

class sampleswitch
{
public static void main(String args[])
{
switch(i){
case 1:
System.out.println("sunday");
break;
case 2:
System.out.println("monday");
break;
case 3:
System.out.println("tuesday");
break;
case 4:
System.out.println("wednesday");
break;
case 5:
System.out.println("thursday");
break;
case 6:
System.out.println("friday");
break;
case 7:
System.out.println(" saturday");
break;
defoult:
System.out.println("empty");
}
}
}

Download Source File

[an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive]
[an error occurred while processing this directive]