mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-24 01:51:38 +00:00
added details for the switch statement for C#
This commit is contained in:
parent
41cf74fa53
commit
67b9af4492
@ -343,6 +343,14 @@ namespace Learning
|
|||||||
case 3:
|
case 3:
|
||||||
monthString = "March";
|
monthString = "March";
|
||||||
break;
|
break;
|
||||||
|
// You can assign more than one case to an action
|
||||||
|
// But you can't add an action without a break before another case
|
||||||
|
// (if you want to do this, you would have to explicitly add a goto case x
|
||||||
|
case 6:
|
||||||
|
case 7:
|
||||||
|
case 8:
|
||||||
|
monthString = "Summer time!!";
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
monthString = "Some other month";
|
monthString = "Some other month";
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user