const and readonly

CONST AND READONLY

 

 

Const:

 

            const is a key word which cannot allow value to change in future. The const will not be static  member. Cannot change value in constructor.value evaluated at compile time.

 

readonly:

 

            readonly can change value in constructor. To use in static method should use static member. Can change value in constructor.value evaluated at runtime.

Next Recommended Reading Const Vs Read-only Keywords in C#