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 are the fundamental principles of oo programming?
What is using keyword in C#?
What is public or shared assemblies ?
What is the difference between throw and throw ex?
What is the process of Serialization?
Explain About sn.exe
Difference between type constructor and instance constructor? What is static constructor, when it will be fired? And what is its use?
Why do we use stringbuilder in c#?
What is type safe in c#?
What is default boolean value in c#?
What are sorted lists?
What is a thread c#?
What is “using” statement in c#?
What is a three-tier application.
What does == mean in c sharp?