Define constants with const keywords and enum : Enum : Data Type C# Examples


C# Examples » Data Type » Enum »

 

Define constants with const keywords and enum









    
using  System;

enum  MyEnum
{
        A
}
class  Constants
{
        public  const  MyEnum  value3  =  MyEnum.A;
}
class  MainClass
{
        public  static  void  Main()
        {
                Console.WriteLine("{0}",  Constants.value3);
        }
}
    
   
  
   



Output

A


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» Enum