Marcus
ReadOnly vs Const?
By Marcus in C# on Jul 05 2011
  • Ajitender Vijay
    Jul, 2011 7

    Const :  A constant member is defined at compile time and cannot be changed at runtime. Constants are declared as a field, using the const keyword and must be initialized as they are declared.

    ReadOnly:  A read only member is like a constant in that it represents an unchanging value. The difference is that a readonly member can be initialized at runtime, in a constructor as well being able to be initialized as they are declared.


    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS