Simple question. Is there any reason an enum cannot inherit from a string or
As far as inheriting from a string, there are a few reasons why this wont
work. 1) enums are value types; strings are implemented as classes. 2) The
System.String class is sealed meaning it can't be inherited from. 3) strings
are immutable.
As far as inheriting from a GUID goes, consider the following: 1) Even
though a GUID is a value type, it takes up 128 bits (16 bytes). This is
overkill as far as most enums go. 2) Part of the beauty of enums is that we
can represent a state or type in a very small space. When defined, we can
tell the compiler the size of the enum.
I guess the overriding question I have, though, is why would you want to
inherit from either?
..ARN.