S.No | Constants | Read-only |
---|---|---|
1 | Constants are dealt with at compile-time. | Read-only variables are evaluated at runtime. |
2 | Constants supports value-type variables. | Read-only variables can hold reference type variables. |
3 | Constants should be used when it is very unlikely that the value will ever change. | Read-only variables should be used when run-time calculation is required. |