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
Explain About CLS?
What is a c# delegate?
What is the default modifier for class in c#?
Explain About sn.exe
What is the difference between int.parse and int.tryparse methods?
What is generic in c#?
What does async mean in c#?
What is the difference between string keyword and system.string class?
Give an example of a directcast.
What is the difference between dictionary and hashtable in c#?
What are the commonly used i/o classes?
What is difference between dictionary and hashtable?
What is the difference between overriding and overloading in systemverilog?
What is ac callback?
Why to use lock statement in c#?