Aryan PrajapatKnowledge Contributor
What are the conventions to be followed for the usage of switch case
What are the conventions to be followed for the usage of switch case
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.
Questions | Answers | Discussions | Knowledge sharing | Communities & more.
Below are the list of conventions should be taken care,
The expression can be of type either number or string.
Duplicate values are not allowed for the expression.
The default statement is optional. If the expression passed to switch does not match with any case value then the statement within default case will be executed.
The break statement is used inside the switch to terminate a statement sequence.
The break statement is optional. But if it is omitted, the execution will continue on into the next case.