int caseSwitch = 2;
the switch is like multiple "if" statements. if the case value matches the switch condition the code for that case is executed, if there is a break inside that "case", the switch statement is exited and the remaining case checks are not performed. the default will execute if the code reaches that point in the "switch" without hitting a break before that.
the return; after the } exits the current function or procedure.
in the current example if there was no "break;" in case 2 the output would be:
with the break it would be: