0
Multi Condition in the Case
Can one, in a case several conditions of the contract? What shape?
2 Réponses
+ 1
If you mean having two cases in one switch block end up doing the same, you'd either want to use an if block instead or do something like
int x = 4;
switch(x)
{
case 4:
goto case 2;
case 2:
Console.WriteLine("x is 4 or 2");
break;
}
though remember, in switch blocks you can always only check the state of one object. If you want to check 2 different objects you will need to use an if block.
0
No. I mean put some criteria in a case. If it's possible to form should be written ...
Thanks for your tips.