コード例 #1
0
        public void Enums()
        {
            pastryType myPastry  = pastryType.Baguette;
            pastryType myPastry2 = pastryType.Cake;

            Console.WriteLine((int)myPastry); //(int) is call casting. converts one type to another, but only certain will work
            Console.WriteLine(myPastry2);     //in enum, every type has a value in it. Hover over pastry types to see them
        }
コード例 #2
0
        public void Enums()
        {
            pastryType myPastry      = pastryType.Doughnut;
            pastryType anotherPastry = pastryType.Croissant;

            Console.WriteLine(myPastry);
            Console.WriteLine(anotherPastry);
        }