Interview Question
Qus: How constant and read only will be different from each other?
Const cannot change the value and even latter module also.
Readonly constant can be change at the runtitme .
1. ReadOnly is a runtime constant while Const is a compile time constant.
2. The value of readonly field can be changed at runtime whereas the value of the const field can not be changed.
Answers (2)
Readonly constant can be change at the runtitme .
2. The value of readonly field can be changed at runtime whereas the value of the const field can not be changed.