switch()
C# 是否总是允许您在语句之间的语句中省略大括号case:
?
像 javascript 程序员经常做的那样,省略它们会有什么影响?
例子:
switch(x)
{
case OneWay:
{ // <---- Omit this entire line
int y = 123;
FindYou(ref y);
break;
} // <---- Omit this entire line
case TheOther:
{ // <---- Omit this entire line
double y = 456.7; // legal!
GetchaGetcha(ref y);
break;
} // <---- Omit this entire line
}