hi,
I was glad to hear that v1.5 the enum class was introduced. I have a piece
of code
public class Input{
public enum Condition {open,close}
private Condition State;
Input (Condition state){State = state;};
protected void SetState (Condition state){State = state;};
protected Condition GetState(){retu rn State;};
}
The compiler gives me the following error :
"enum declarations allowed only in static contexts"
The enum in this example is just used as a type to my variable.
What is wrong here?
What purpose does it have than in respect to other langauges like C ?
I was glad to hear that v1.5 the enum class was introduced. I have a piece
of code
public class Input{
public enum Condition {open,close}
private Condition State;
Input (Condition state){State = state;};
protected void SetState (Condition state){State = state;};
protected Condition GetState(){retu rn State;};
}
The compiler gives me the following error :
"enum declarations allowed only in static contexts"
The enum in this example is just used as a type to my variable.
What is wrong here?
What purpose does it have than in respect to other langauges like C ?
Comment