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
Explain what are the steps for creating clr trigger?
What is a deadlock lock?
Can you put two constructor with the same structure in a class?
Can a struct inherit from an interface in c#?
What is thread and explain states of a thread in c#?
What is xaml file in c#?
Is as keyword in c#?
Enlist all the components of an ado.net framework?
What is the difference between list and ilist in c#?
What is a linq in c#?
What is the difference between an application domain and a process?
Is unboxing an implicit conversion?
Why do you need boxing in c#?
Is goto statement supported in c#?
Can constructor be protected in c#?