3
Reply

What is the role of [Flag] attribute in enums?

Rehman Shahid

Rehman Shahid

5y
5.1k
4
Reply

    The [Flag] attribute is used when Enum represents a collection of multiple possible values rather than a single value.

    All the possible combination of values will come.

    For Example:-
    enum a={1,2,3,4}

    4*4 combination will occur

    The [Flags] attribute should be used whenever the enumerable represents a collection of possible values, rather than a single value.