How to use enum datatype in interface?
Is this possible?
public interface IParent1
{
string method1(Test enum);
}
public class Parent1 : IParent1
{
public enum Test
{
A,
B,
C
}
public string method1(Test enum)
{
return enum.ToString();
}
}
enumis a reserved keyword in C#. You can prefix it with@if you want to use it as variable name:But I don’t like using reserved words for variable names. A better approach would be: