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
Can you prevent a class from being instantiated?
What is callback delegate in c#?
Can you call from an inherited constructor to a specific base constructor if both base class and an inheriting class has a number of overloaded constructors?
What is args c#?
What is msil, and why should developers need an appreciation of it if at all?
How is exception handling implemented in c#?
Can constructor have return type c#?
How to sort an int array in c#?
Why do we need events in c#?
How to find type of variable?
How many constructor can a class have?
Can you describe iuknown interface in short?
Explain About stateless and state full web service
How do you name a variable in c#?
Why References are stored on heap and variables on stack?