home screen

Search



Number Of Result : 0

Result :


Monday, December 22, 2008

C#'s const vs. readonly

A quick synopsis on the differences between 'const' and 'readonly' in C#:

'const':
- Can't be static.
- Value is evaluated at compile time.
- Initiailized at declaration only.
'readonly':
- Can be either instance-level or static.
- Value is evaluated at run time.
- Can be initialized in declaration or by code in the constructor.

No comments: