enum Color {Red, Green, Blue};
class Program { enum Size {Small, Medium, Large}; static void Main(string[] args) { Size size = Size.Medium; Console.WriteLine(size); } }This example demonstrates how to use an enum type. It declares an enum type named Size that contains three named constants: Small, Medium, and Large. It then declares a variable named size of type Size and assigns the value Medium to it. Finally, it prints the value of size to the console. The System.Enum class is part of the .NET Framework Class Library.