what is the main differnce between const,readonly and static
Answer Posted / raja
1. we can initialize constant variable only at the
declaration where as readonly varaiable can be initialized
at either declaration or in constructor.
2. we can't use static modifier for the const variable
where as readonly variable can be declared as static
Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
Explain types of comment in c# with examples
Is array value type in c#?
Can you store different types in an array in c#?
What is private constructor c#?
What is instantiating a class?
What is garbage collection? How to force garbage collector to run?
Can we change static value in c#?
What is the difference between returning iqueryable vs ienumerable?
What is a Jagged Array in C#?
What are delegate methods?
What are events in C#?
What is yield break in c#?
What is meant by desktop application?
What is foreach loop in c#?
What is the real use of interface in c#?