January 2011
Intermediate to advanced
1648 pages
70h 30m
English
What we haven’t explained yet is where the (constant) values for the enum’s members come from. Because we didn’t specify any values here, the enum will automatically get consecutive constant values for its members, starting from zero. So the definition of our Color enum is equivalent to the following:

You can see those values by casting an enum value to the underlying type. Notice that calling ToString on an enum will actually print the symbolic name corresponding to the enum member:
![]()
Instead of relying on the automatic ...
Read now
Unlock full access