Constansts in C#: const VS readonly

Pop quiz: What’s the difference between these three declarations? And, more importantly, when should you use each one? private const int _Millenium = 2000; private static readonly DateTime _classCreation = DateTime.Now; private readonly DateTime _InstanceTime = DateTime.Now; The first creates a compile-time constant, the second creates a run-time class constant, and the third creates a … Read more