|
Listing 9-22 extracted from chapter Fundamental concepts of the language
Listing 9-21< > Listing 9-23
This listing can be compiled with the command line: csc.exe /target:exe Example_9_22.cs Errors: 0 Warnings: 0
Example_9_22.cs
class Program {
static void Main() {
int i = 6; int j = 7;
switch (i){
case 1:
System.Console.WriteLine("executing case 1");
goto default;
case 6:
System.Console.WriteLine("executing case 6");
if (j > 2) goto case 1;
break;
default:
System.Console.WriteLine("executing default");
break;
}
}
}
Copyright Patrick Smacchia 2006 2007
|