What is difference between constants and readonly?

Technology CommunityCategory: C#What is difference between constants and readonly?
VietMX Staff asked 3 years ago

Constant variables are declared and initialized at compile time. The value can’t be changed afterwards. Readonly is used only when we want to assign the value at run time.