Enum data type comparison
using System;
enum EmpType : byte {
Manager = 10,
Grunt = 1,
Contractor = 100,
VP = 9
}
class Program {
static void Main(string[] args) {
EmpType Joe = EmpType.VP;
EmpType Fran = EmpType.Grunt;
if (Joe < Fran)
Console.WriteLine("Joe's value is less than Fran's value.");
else
Console.WriteLine("Fran's value is less than Joe's value.");
}
}
Related examples in the same category