ch3-Flavor enumeration

Chapter_3     Exercise_3-7 Exercise_3-8







Flavor.cs     TCS, p. 64


public class FlavorTest
{
enum Flavor
{
Vanilla = 1, Chocolate = 2, Strawberry = 4, Coffee = 8
}

public static void Main()
{
Flavor conePref = Flavor.Vanilla | Flavor.Coffee;
System.Console.WriteLine(conePref);
}
}
/*
mcs Flavor.cs
mono Flavor.exe
9
*/









Chapter_3     Exercise_3-7 BACK_TO_TOP Exercise_3-8



Comments

Popular posts from this blog

Contents