- whose value shouldnot be changed as "Const" but where the value is not known until runtime.
- "Const" fields are internally static, but we need to declare as static for "Readonly" fields.
- Readonly fields are constants and also allow to do some calculations to determine the initial value of the fields, but const fileds are not.
- We can assign values to Readonly fields in constructors only not anywhere else.
Friday, January 29, 2010
Subscribe to:
Post Comments (Atom)
Gool link to learn about Readonly fields,constants...
ReplyDeletehttp://en.csharp-online.net/const,_static_and_readonly