Take a look at my first comment in this thread : http://groups.google.com/group/DotNetDevelopment/browse_thread/thread/a15afb545c9d6c4b
My understanding of the C# switch statement is that since constants are provided as switch cases, the compiler is able to optimize the execution according to the datatype of the switch(variable). It may then implement the branching as a hashtable or a dynamic lookup. Even when you debug switch cases, you will observe that the control does not go to each case statement (as would happen in an "if - else if - else" construct), rather it jumps to the case statement matching the value of the variable. Due to these factors, the C# switch block cannot have been implemented internally as an If-else construct. On Dec 19, 8:59 am, Sreenivas <[email protected]> wrote: > Sorry to the group for making incorrect statement... > Can you elaborate on this point Cerebrus... > > On Dec 19, 12:48 am, Cerebrus <[email protected]> wrote: > > > > > Sorry, but that is just plain wrong. > > > On Dec 18, 12:12 pm, Sreenivas <[email protected]> wrote: > > > > FYI ,Switch statement is implemented as IF-else statement > > > internally..........- Hide quoted text - > > - Show quoted text -
