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 is parallel foreach c#?
Is c# and .net same?
Why c# is called c sharp?
What is difference between static and constant variable?
Difference between debug.write and trace.write?
How does aspect oriented programming work?
Explain About sn.exe
What are the Types of values mode can hold session state in web.config
What is static class in C#?
What is use of FormBoarderStyle Propertie
What are escape sequences explain with example?
Can class be protected in c#?
Is as operator in c#?
How does dictionary work in c#?
Explain the difference between “system.array.clone()” and “system.array.copyto()” in c#?