I have read some code about Switch statement in Java Language. I noted that written the next code, I have this output:
FEBO SERR JANUO January 2
Code:
int month = 2;
String monthString = "";
switch (month) {
case 2:
monthString = "FEB";
System.out.print("FEBO ");
default:
monthString = "ERROR";
System.out.println("SERR ");
case 1:
monthString = "January";
System.out.println("JANUO ");
break;
}
System.out.print(monthString+ " ");
System.out.print(month);
I hoped the next output really:
FEBO SERR FEB 2
Why I got that first output?
Thanks in advance.