Practice mode C#

Which statement about the C# switch statement is true?

Correct answer D. Control cannot fall through from one non-empty case section to the next

Explanation

Unlike C, C# forbids implicit fall-through: each non-empty switch section must end with break, return, throw, goto or a similar jump, or the compiler reports an error. Several labels may share one section by stacking them. case labels can be strings, enums, constants or any pattern, and default is optional.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.