Difference between Constant and Read-only ?


Constant
Read-Only
Value never changed.
Value can be changed in the constructor of the class.
Declared and Initialized in Compile time.
Declared and Initialized in Run time.
By default Constant is static, Cannot be declared as static.
Can be declared as Static.

Comments

Popular posts from this blog

List out different return types of a controller action method?

3-6 yr Experience Interview Questions in .Net Technologies

Explain what is the difference between View and Partial View?