What are readonly and constant members? Like to have a practical and clearn understanding of it.
Thanks,
Puran
What are readonly and constant members? Like to have a practical and clearn understanding of it.
Thanks,
Puran
Know the answer? Post it. Somebody with the same question will find it here.
Jarmo Jokela2 pointsPosted May 24, 2009, 11:37 PM EDT
Constant variables are, well, constant, meaning that you can't alter their values after they're set.
Readonly variables are like constants, but you can change their values in constructor.
Below is a code sample: