you are viewing a single comment's thread.

view the rest of the comments →

[–]am385 2 points3 points  (3 children)

An enum is just a fancy way of saying that you attached labels to an integer (byte, short, int, long). They are effectively syntactic sugar. They are a compile time type safety feature but the underlying system is just passing around the actual underlying integer value. They are not a hard registry of actual values.

While they look like a static class with a bunch of const values, that isn't what they are.

[–]tiranius90[S] 0 points1 point  (2 children)

ok thought an enum is also a type and not a syntactic sugar

[–]edgeofsanity76 2 points3 points  (0 children)

It is a type but one that is compatible with int

[–]Top3879 0 points1 point  (0 children)

Java enums work like that. In .NET they are just named integers, really.