Qus:    How constant and read only will be different from each other?
Dec 07, 2020 21:28 DotNet 2 Answers Views: 1433 RAMU

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.

Prev Next
Answers (2)
SHIVA Dec 08, 2020 14:29
Answer:   Const cannot change the value and even latter module also.
Readonly constant can be change at the runtitme .

PARTH Dec 09, 2020 13:06
Answer:   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.

Post Your Answer
Guest User

Not sure what solution is right for you?

Choose the right one for you.
Get the help of the experts and find a solution that best suits your needs.


Let`s Connect