Answer:
The major differences between both the keywords are listed below:
'const':
-cannot be static
-value is evaluated at compile time
-initialized at compile time only
'readonly':
-can't be either instance level or static
-value is evaluated at compile time
-can be initialized in declaration or by code in the constructor
Asked In: Many Interviews |
Alert Moderator