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
Can we override static class in c#?
What is data quality assurance?
What is difference between method and function in c#?
What is a protected class c#?
What is transparent caching with aop ?
Difference between StackPanel and RelativePanel ?
How a two-dimensional array declared in C#?
What is the class in c#?
Can you inherit multiple abstract classes in c#?
Explain the process of Serialization?
Can we inherit class that contains only one private constructor?
What is the difference between field and property in c#?
What is difference between constants and read-only?
What is verbatim string?
What is namespace give the example?