Relative Content

Tag Archive for javaswitch-statementcaselanguage-designbreak

Why do we need break after case statements?

Why doesn’t the compiler automatically put break statements after each code block in the switch? Is it for historical reasons? When would you want multiple code blocks to execute?