We know that C# supports const and readonly variables and generally uses them interchangeably, but we also should notice that they offer different behaviors. Always remember, const is compile time and readonly is runtime. This will always help in choosing the correct one according to situation.
source https://www.c-sharpcorner.com/article/runtime-and-compiletime-constants-in-c-sharp/
No comments:
Post a Comment