What are the differences between enum and class ?

public enum Colors{[Description("Red")]Red,[Description("White")]White,[Description("Blue")]Blue,[Description("Green")]Green}
using System;using System.ComponentModel;namespace EnumApp{public enum Colors{  [Description("Red")]   Red,  [Description("White")]   White,   [Description("Blue")]   Blue,   [Description("Green")]   Green}class Program{   static void Main(string[] args)   {     String color = "White";     switch(color)     {       case "Red":        Console.WriteLine("Color is " + Colors.Red);       break;       case "White":        Console.WriteLine("Color is " + Colors.White);       break;       case "Blue":        Console.WriteLine("Color is " + Colors.Blue);       break;       case "Green":        Console.WriteLine("Color is " + Colors.Green);       break;      default:       Console.WriteLine($"{color} is a unknown color by system");      break;  }   Console.ReadLine();  } }}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store