Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to break switch case in java

// break reserved word is used to break out of a switch case
char letter = 'a';
int aCount = 0, bCount = 0, other = 0;

switch(letter) {
case 'a':
	aCount++;
    break;
case 'b':
	bCount++;
    break;
default:
	other++;
}
 
PREVIOUS NEXT
Tagged: #break #switch #case #java
ADD COMMENT
Topic
Name
2+9 =