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
How to implement delegates in c#.net
Explain About CLS?
What is a .aspx file?
What is console writeline in c#?
What are interfaces in c#?
When To use HashTable In C#
Can c# inherit multiple classes?
What is a cshtml file?
Explain manifest & metadata in c#.
How to implement an object pool in c#.net.
Is c# front end or back end?
Define multicast delegate in c#?
How string definitions will prevent escaping on backslashes in C#?
What are the collection types can be used in c#?
Is it possible to have different access modifiers on the get/set methods of a property in c#?