Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

switch statement in java

int x = 5;
switch(x) {
case 1:
    System.out.println("You entered 1");
    break;
case 2:
    System.out.println("You entered 2");
    break;
default:
    System.out.println("You entered: "+x);
}	
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #switch #statement #java
ADD COMMENT
Topic
Name
5+8 =