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 more on CLR
What is event sourcing in c#?
What is Private Constructor? and it’s use? Can you create instance of a class which has Private Constructor?
Explain use of abstract and sealed classes in c#?
What is the adv of using System.Text.StringBuilder over System.String?
What is int tryparse in c#?
What is int32 maxvalue?
What is executenonquery c#?
What is type safe in c#?
How to put assembly in gac?
When should we use sealed class in c#?
How long does it take to get a loop recorder put in?
What types of object can I throw as exceptions?
Can we inherit a class with private constructor in c#?
Can c# inherit multiple classes?