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
Difference between StackPanel and RelativePanel ?
Why is hashset faster?
What are Memory foot print of an exe?
What is difference between comparable and comparator?
What is the difference between add and addrange in c#?
Can properties be static in c#?
Is a decimal an integer?
Are there functions in c#?
What is reflection c#?
How is lazy loading achieved?
Describe ado.net?
Is clr a compiler?
What is xml comments in c#?
What is cookies c#?
What are the problem with .NET generics?