From MSDN: A const field can only be initialized at the declaration of the field. A readonly field can be initialized either at the declaration or in a constructor. Therefore, readonly fields can have different values depending on the constructor used. Also,
while a const field is a compile-time constant, the readonly field can be used for runtime constants as in the following example: public static readonly uint l1 = (uint) DateTime.Now.Ticks; Hope this helps, Appan
ASP.NET Team
This posting is provided "AS IS" with no warranties, and confers no rights.
None
0 Points
32 Posts
const and static readonly
Dec 02, 2003 12:14 AM|newvendor|LINK
Member
10 Points
340 Posts
Re: const and static readonly
Dec 02, 2003 12:30 AM|appana|LINK
This posting is provided "AS IS" with no warranties, and confers no rights.