Activity Forums Salesforce® Discussions What is Enums in Salesforce Apex?

  • Anuj

    Member
    February 6, 2020 at 12:30 pm

    Hi Arun,

    An enum is an abstract data type with values that each take on exactly one of a finite set of identifiers that you specify. Enums are typically used to define a set of possible values.

    For Example.

    public enum Season {WINTER, SPRING, SUMMER, FALL}

    Season e = Season.WINTER;

    Season CheckSeason(Season e) {
    if (e == Season.SUMMER){
    return e;
    }
    }

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos