- 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.
Gool link to learn about Readonly fields,constants...
ReplyDeletehttp://en.csharp-online.net/const,_static_and_readonly
Readonly fields can be initialized either at initialization or in constructor...
ReplyDeleteinitialization means at the time of declaration
ReplyDelete