What is the difference between const and static read-only?
The difference is that static read-only can be modified by the containing class, but const can never be modified and must be initialized to a compile time constant. To expand on the static read-only case a bit, the containing class can only modify it:
-- in the variable declaration (through a variable initializer).
-- in the static constructor (instance constructors if it's not static).
A const must be initialized at the time of its creation. A readonly field can be assigned to once in the class constructor allowing you to pass in the value at run-time. Declaring fields as const protects both you and other programmers from accidentally changing the value of the field. Also note that with const fields, the compiler performs some optimization by not declaring any stack space for the field. The readonly keyword is similar to const, with two exceptions. First, the storage of a readonly field is the same as a regular read-write field, and thus there is no performance benefit. Secondly, readonly fields can be initialized in the constructor of the containing class.
RE: What is the difference between const and static read-only?
A const must be initialized at the time of its creation. A readonly field can be assigned to once in the class constructor allowing you to pass in the value at run-time. Declaring fields as const protects both you and other programmers from accidentally changing the value of the field. Also note that with const fields, the compiler performs some optimization by not declaring any stack space for the field. The readonly keyword is similar to const, with two exceptions. First, the storage of a readonly field is the same as a regular read-write field, and thus there is no performance benefit. Secondly, readonly fields can be initialized in the constructor of the containing class.
Readonly also usefull to give a constant value which is constructor independent.Constant is initialize at compile time where Readonly is initiaize at runtime (but from constructor only).Now Static Read-only can't be initialize from any normal (private, public, protected) constructor or any method. To initialize Static read-only u have to create a Static Constructor of that class.So there is no any major difference betn Const and Static Read-only...identically both r same for access level except their storage location is difference.