Enum elements compare : System.Enum : Data Type C# Examples


C# Examples » Data Type » System.Enum »

 

Enum elements compare









    
using  System;

enum  EmployeeType  :  byte  
{
    Manager  =  10,
    Programmer  =  1,
    Contractor  =  100,
    Developer  =  9
}

class  MainClass
{
    public  static  void  Main(string[]  args)
    {
        EmployeeType  Joe  =  EmployeeType.Developer;
        EmployeeType  Fran  =  EmployeeType.Programmer;

        if(Joe  <  Fran)
            Console.WriteLine("Joe's  value  is  less  than  Fran's");
        else
            Console.WriteLine("Fran's  value  is  less  than  Joe's");

    }
}
    
   
  
   



Output

Fran's value is less than Joe's


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» System.Enum