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

Explain what is routing in MVC? What are the three segments for routing important?

What is the difference between “HTML.TextBox” vs “HTML.TextBoxFor”?

Explain what is the difference between View and Partial View?