C# – Understanding the Switch Statement

Think: train switch… logic based on evaluation of a variable or property value.

switch(whatIDo){
  case Occupation.Doctor;
   ......
   break;
  case Occupation.Lawyer;
   .....
   goto case Occupation.Doctor;
  default:
   break;
}

 

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.