+ 10
What is the error in this code?
int age = 22; switch(age) { case 16: Console.Write("y"); break ; default: Console.Write("o"); }
5 Answers
+ 3
You are missing break; after default case.
+ 4
the Switch Statement is Not a loop. After the write it will quit the brackets.
it is not wrong, just Not necessary.
are there any security issues when you keep it away?
the Switch Statement is just a nested if-else-structure
+ 3
I am confused. Where is the difference? And Why?
+ 3
He is missing break; statement and break tells block of code to stop. Otherwise it can't get out of switch statement.
+ 3
He should write break; like this:
Console.write("o");
break;