Get to know Enums - CSharp Custom Type

CSharp examples for Custom Type:Enum

Introduction

An enum is a value type who has a group of named numeric constants.

For example:

public enum Direction { Left, Right, Top, Bottom }

We can use this enum type as follows:


Direction topSide = Direction.Top;
bool isTop = (topSide == Direction.Top);   // true
     

Related Tutorials