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's the difference between system.string and system.text.stringbuilder classes?
What is windows forms in c#?
How to add controls dynamically to the form using c#.net.
What is append in c#?
What are extensions methods in c#?
What is the process of delegation?
What is the use of parse in c#?
Which function is the entry point for a DLL in MS Windows 3.1?
Explain the 3 types of properties in c# with an example?
What does a constructor do c#?
How to transpose multi-dimensional array?
What is strong data type in c#?
Can abstract class be sealed in c#?
Is list immutable in c#?
What is the resgen.exe tool used for?