C # Switch-Anweisung mit / ohne geschweifte Klammern ... was ist der Unterschied?
Hat C # immer erlaubt, geschweifte Klammern innerhalb eines @ wegzulassswitch()
Anweisung zwischen demcase:
Aussagen?
Was bewirkt das Weglassen, wie es Javascript-Programmierer oft tun?
Beispiel
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
}