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 local function?
What is literal in c#?
What is the process of Serialization?
Is c# easier than javascript?
What is as keyword in c#?
Define an assembly in .net?
Is string null or empty?
What is using keyword in C#?
How do we achieve encapsulation in c#?
Explain about CTS?
How do you declare a method in c#?
What are extension methods and where can we use them?
What is difference between for and foreach in c#?
What is difference between === and ==?
What is difference between event and delegate in c#?