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.
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.
thanks for sharing.. for more example check http://aspnettutorialonline.blogspot.com/2012/04/difference-between-const-and-readonly.html
ReplyDelete