class enum_class
{
public static void Main()
{
Gender Unknown = (int)Season.Winter;
Console.WriteLine(Unknown);
Console.WriteLine(Gender.Unknown);
}
}
public enum Gender
{
Unknown = 10;
}
public enum Season
{
Winter = 1;
}
In the above code I wish to assign the value of variable Winter to variable Unknown.
Now Console.WriteLine(Unknown); gives the expected output i.e. Unknown value is changed from its initial value 10 to 1.
However, Console.WriteLine(Gender.Unknown); prints 10 as its output which was its original value. May I know the reason behind this?!!