Why do we need break after case statements?

Posted by kunjaan on Stack Overflow See other posts from Stack Overflow or by kunjaan
Published on 2010-04-25T22:58:15Z Indexed on 2010/04/25 23:03 UTC
Read the original article Hit count: 166

Filed under:
|
|
|

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?

© Stack Overflow or respective owner

Related posts about switch

Related posts about java