An example Analysis of C # enumeration types
This article mainly explains "example Analysis of C# enumeration types". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Now let the editor to take you to learn the "C # enumeration type example analysis"!
Example demonstration of C # enumerated types
/ * Created by SharpDevelop. * User: noo * Date: 2009-8-16 * Time: 21:03 * * C# enumerated type * / using System Enum enumA:int {east,//0 south,//1 west,//2 north,//3} enum enumB// defaults to int-type {left,//0 right,//1} enum enumC:byte {top, buttom,} / / C # enumerated type class Test {static void Main () {enumA axioms A.east. enumA b=enumA.south EnumA caterpillar A.West; enumA dumbbell A.north; Console.WriteLine (a); Console.WriteLine (b); Console.WriteLine (c); Console.WriteLine (d); int aa= (int) enumA.east; int bb= (int) enumA.south; int cc= (int) enumA.west; int dd= (int) enumA.north Console.WriteLine (aa); Console.WriteLine (bb); Console.WriteLine (cc); Console.WriteLine (dd); enumB x=enumB.left; enumB y=enumB.right; int z = (int) enumB.left; Console.WriteLine (x); Console.WriteLine (y); Console.WriteLine (z) / / C # enumerated type enumC p=enumC.top; enumC q=enumC.buttom; byte r = (byte) enumC.buttom; Console.WriteLine (p); Console.WriteLine (Q); Console.WriteLine (r);}}
Run result of C# enumerated type instance
At this point, I believe that you have a deeper understanding of the "C # enumeration type example analysis", might as well come to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!