int a = 5;
switch(a) {
case 2, 3 {
a = 5;
}
case 4, 5 {
a = 6;
}
default {
a = 0;
}
}
Multiply cases can share the same codeblock by seperation of cases with a comma. Cases never fall through and are always contained in the curly braces that follow the,m.
Switch case should look like the following:
Multiply cases can share the same codeblock by seperation of cases with a comma. Cases never fall through and are always contained in the curly braces that follow the,m.