Top "Switch-statement" questions

In computer programming, a switch, case, select or inspect statement is a type of selection control mechanism used to invoke specific blocks of code based on variable contents.

Using Case/Switch and GetType to determine the object

Possible Duplicate: C# - Is there a better alternative than this to ‘switch on type’? If you want to switch …

c# .net reflection switch-statement case
C# switch on type

Possible Duplicate: C# - Is there a better alternative than this to 'switch on type'? C# doesn't support switching on …

c# switch-statement typeof
How to use null in switch

Integer i = ... switch (i){ case null: doSomething0(); break; } In the code above I cant use null in switch case statement. …

java switch-statement
C# how to use enum with switch

I can't figure out how to use switches in combination with an enum. Could you please tell me what I'm …

c# enums switch-statement switch-expression
Switch statement fallthrough in C#?

Switch statement fallthrough is one of my personal major reasons for loving switch vs. if/else if constructs. An example …

c# switch-statement
VB.NET Switch Statement GoTo Case

I am writing some code in VB.NET that uses a switch statement but in one of the cases it …

vb.net switch-statement goto
Best way to do a PHP switch with multiple values per case?

How would you do this PHP switch statement? Also note that these are much smaller versions, the 1 I need to …

php switch-statement
Using switch statement with a range of value in each case?

In Java, is it possible to write a switch statement where each case contains more than one value? For example (…

java if-statement switch-statement
Switch case with fallthrough?

I am looking for the correct syntax of the switch statement with fallthrough cases in Bash (ideally case-insensitive). In PHP …

bash switch-statement
Switch case in C# - a constant value is expected

My code is as follows: public static void Output<T>(IEnumerable<T> dataSource) where T : class { …

c# switch-statement