Can an enum be an object?

Because an enum is technically a class, the enum values are technically objects . As objects, they can contain subroutines. One of the subroutines in every enum value is named ordinal(). When used with an enum value, it returns the ordinal number of the value in the list of values of the enum.

Sizin İçin Seçtik  Madende çalışmak zor mu?

Leave a Reply

Your email address will not be published. Required fields are marked *