Differ b/w “readonly” and “const” in C#
You must be logged in to reply to this topic.
what is the differents between the “const” and “readonly” in C#. Both of them were used for constant value but why these two?
Constant
1) This must be initilize at the time of declaration.
2) This is same for all of objects class.
3) It initilize at the time of compilation.
Readonly
1)This can be initilize at the time of object creation.
2) This may be different for different objects of class.
3) It Initilize at Runtime.
You must be logged in to reply to this topic.