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 can you force derived classes to provide new method implementations for virtual methods?
How can I check the type of an object at runtime?
Define a partial class?
What is use of private class in c#?
What is assembly manifest?
Explain the difference between access specifier and access modifier in c#?
What is use of FormBoarderStyle Propertie
Why are mutable structs evil?
What is the concept of strong names?
What is boolean method?
How do you pronounce c#?
Define multicast delegate in c#?
What is a static in c#?
Distinguish between array and arraylist in c#?
What are console applications used for?