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.
Reference page:
Http://www.yuanjiaocheng.net/mvc/mvc-views.html
Http://www.yuanjiaocheng.net/Hibernate/first.html
Http://www.yuanjiaocheng.net/webapi/web-api-host.html
Http://www.yuanjiaocheng.net/ASPNET-CORE/core-actionresults.html
Http://www.yuanjiaocheng.net/CSharp/csharp-extension-method.html
Http://www.yuanjiaocheng.net/ASPNET-CORE/core-identity-migrations.html
Http://www.yuanjiaocheng.net/ASPNET-CORE/core-setup-entityframework.html
Http://www.yuanjiaocheng.net/mvc/bundling-and-minification-in-asp.net-mvc.html
Http://www.yuanjiaocheng.net/mvc/mvc-razor-yufa.html
Http://www.yuanjiaocheng.net/mvc/mvc-helper-TextArea.html
Http://www.yuanjiaocheng.net/mvc/mvc-helper-textbox.html
. NET uses switch in a different place than Java.