Surely the compiler knows that it’s the last label of the switch statement?
Surely the compiler knows that it’s the last label of the switch statement?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Having a break after your switch’s final case statement is good defensive programming. If, perhaps in the future, another case statement is added below, it removes the risk of the program’s flow falling through from the case above.