Enums in C#

namespace CSharpBasics
{
    //Purpose is to declare constants
    //Default value for 1st const is 0 (unless specified)
    //If previous const is marked as 10, then const will automatically gets 11 (unless specified)
    enum Enumerations
    {
        def, // = 0
        Hello = 11,
        Hi, // = 12
        ok = 20
    }
}

Add Comments :

Login

Register