I was going through a code of switch conditional statement
char c1=65;
switch(c1){
case 'A':
System.out.println("one");
default:
System.out.println("two");
case 'b':
System.out.println("three");
}
While the outcome was ‘one two three’ but while debugging I found that it first enters the case A which is the ASCII value 65 of A , but then it also executes all the remaining cases but if I put break; then it comes out , so does this means if we don’t put break it will continue to execute all the cases please advise.
It will continue to execute it until reaches break.
Here you can read more info about switch Statement.