What is the difference between readonly and const
Answer Posted / porchelvi.a
Constant:
--------
we have to initialize at the declaration itself
we could not change the value of constant variable.
Read only:
----------
we can not initialize the Read only variable during
declaration.we can initialize it in constructor only.after
that we could not change the value.Read noly is instance
based variable.
Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
What does int32 mean?
Is linkedhashset synchronized?
What is console write in c#?
Is and as keyword in c# net?
What does typeof return c#?
What is the difference between throw and throw ex?
How big is a 64 bit integer?
What is array formula?
What is dynamic in c#?
What is data binding c#?
What is difference between ienumerable and ienumerator in c#?
What is literal in c#?
What does console readline do in c#?
Is multiple inheritance possible in c#?
What is a console device?