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 data set in c#?
What is ControlBox Propertie
Is it possible to have a static indexer in c#?
Is it possible to execute multiple catch block for a single try statement?
What does namespace mean?
What is yield in c#?
Is c# and .net same?
How do I declare inout arguments in c#?
Is c sharp and c# are same?
Can dictionary have duplicate keys c#?
What is a di class?
Why delegate is used in c#?
What is icomparer in c#?
What is the max value of int32 in c#?
What is the usage of OLE?