InterviewSolution
Saved Bookmarks
| 1. |
Constant vs Readonly in C# |
|||||||||||||||||||||
|
Answer» The const in C# is faster than readonly, but the performance of const is not better than readonly.
A value with const KEYWORD cannot change throughout the LIFE of a program. A const variable cannot be reassigned.
A value with Readonly keyword whose value can be initialized during runtime, unlike const. Let us now see the DIFFERENCE:
|
||||||||||||||||||||||