C# Tips

Today's C# Quiz

Quiz

Enum.GetNames() method has the following prototype:

public static string[] GetNames(Type enumType);

When an enum type called MsgType is defined as follows, which of the following cannot be used as a parameter of Enum.GetNames() method?

public enum MsgType {Info, Warning, Error}

typeof(MsgType)
Type.GetType("MsgType")
When variable t is MsgType, t.GetType()
When variable t is MsgType, (t as MsgType)

Tip

Answer