#2:Enum With Flags

Enum can take Flags as attribute and perform bit operations over the numerics(Values must be power of two).

public enum Color

var combination = Color.Red | Color.Green;
Console.WriteLine(combination); /* Red,Green*/

They are helpful when you need to hold multiple values/Combination  of values defined in an Enum.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s