January 2011
Intermediate to advanced
1648 pages
70h 30m
English
Similar to, yet different from, read-only fields are constants. Constants aren’t fields but deserve treatment in this context because of their similar syntax and to point out some of the fundamental differences.
The goal of constants is to provide a way to declare values that will never change both during the duration of the program until eternity. Examples of constants include e (2.71828...) and Pi (3.14159...). Things that seem constant but deceptively are not include values such as tax percentages.
For example, System.Math defines a couple of public constants:

Constants can be computed at compile time and are stored in the metadata ...
Read now
Unlock full access