This is a created article in which the information may have evolved or changed.
Golang and C # switch differences
Go is a compiled, parallelized and garbage-collected programming language developed by Google.
C # is an object-oriented, high-level programming language running on the. NET framework that Microsoft publishes.
Although the main use of the development process is not C #, but the development process will inevitably read the C # code, the following is the comparison of the two domain name switch
Switch for 1.Go:
Output:
Switch of 2.c#
Output:
In summary, each key in go corresponds to a case, there is no corresponding case, then the default is executed, there is no default this does not execute code, in the same case statement, you can separate the different conditions with commas; in C #, Control cannot be run from one case label to another, and the end-use label must not have a Break,key counterpart, and if no code is executed, it will be deferred until the end of the break.
Wxgzh:ludong86