What is the Difference between read only and constant
variables?
Answer Posted / kishore maddineni
all above answers are correct.But there is another point.
readonly variable can be assigned at declaration or at run
time which is must be in constructor. Readonly value can't
be modified.
Constant variable must be assigned at the time of
declaration only ,which is can't be modified.
Is This Answer Correct ? | 36 Yes | 7 No |
Post New Answer View All Answers
What is dll hell, and how does .net solve it?
Why we need get set property in c#?
What are the types of assembly available
How does it work?
what is IFormatable
How do I link two windows forms in c#?
What are the 3 elements of delegation?
Can we override interface method?
If I have more than one version of one assemblies, then how'll I use old version (how/where to specify version number?)in my application?
What is a clr host?
What is the advantage of constructor in c#?
What are logical operators in c#?
Are all methods virtual in c#?
What is the purpose of static?
Can a string be null c#?