What is the Difference between read only and constant
variables?
Answer Posted / vijay bhaskar semwal
some more difference
Unlike const, when using readonly, the value is set when
the instance is created. This means that you can specify
the value of the readonly in the constructor of your class.
Another difference between const and readonly, is that
const are static by default, where with readonly, you must
define it as static (if you want it to be).
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is lock statement in C#?
What is an object and a class?
What is the difference between hashtable and dictionary?
What is a static class in c#?
What are the types of comments in c#?
Is the following code legal?
Define property in c#.net?
What is difference between abstract class and interface in c#?
Is char * null terminated?
Explain how to parse a datetime string?
Is list passed by reference c#?
What I can do with c#?
What is the difference between a variable and a literal?
What is the use of generics in c#?
What is the predicate of a sentence?