Q:

What is the difference between “constant” and “readonly” variables in C#?

0

What is the difference between “constant” and “readonly” variables in C#?

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

“Const” keyword is used for making an entity constant. We cannot modify the value later in the code. Value assigning is always mandatory to constant variables.
“readonly” variable value can be changed during runtime and value to readonly variables can be assigned in the constructor or at the time of declaration.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now