In this chapter:
In this chapter, I'll show you how to add data members to a type. Specifically, we'll look at constants and fields.
A constant is a symbol that has a never-changing value. When
defining a constant symbol, its value must be determinable at compile
time. The compiler then saves the constant's value in the assembly's metadata. This
means that you can define a constant only for types that your compiler considers
primitive types. In C#, the following types are primitives and can be used to define
Boolean, Char, Byte, SByte, Int16, UInt16, Int32,
UInt32, Int64, UInt64, Single, Double, Decimal, and
String. However, C# also allows you to define a constant ...