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
}