1. This cannot be done through
We know that Java and C can do this when using switch.
Switch (i)
{
Break is not used here in Java
Executes case 1: The corresponding statement is followed directly through the statement in case 2:.
Case 1:
Console.WriteLine ("111");
Case 2:
Console.WriteLine ("222");
Break
Default
Console.WriteLine ("333");
Break
}
But this in C # will cause an error.
In C #, you must have a break for each case that has a statement.
Like this
2. Does it mean that the case in C # cannot be penetrated? No!
When there is no code in a case statement, it can be run through.
That's all I have to say, and there will always be some small differences in different languages. But the mind is the same.
Each language has its own way of expression, seeking the same and different.
These different places don't mean who's good or bad ...
Like any language in the world, sing the most wonderful songs.
Programming world, no spam language, just use the people uneven.
. NET uses switch in a different place than Java.