Followup on Enums

In a follow-up to my last post, Eric Bachtal pointed out that I could use a class with only public constants to accomplish just about the same thing:

public class RowStatus
{
    public const int BadMap = 1;
    public const int BadBaro = 2;
    public const int BadCA50 = 3;
}

Great idea!  And I'm surprised I forgot about that since I used this very technique about 4 years ago when I had to do some Java coding.  Without Java supporting enums, the technique above was the best way to accomplish the same thing.  Thanks Eric!

No Comments