Difference between static, const, read-only and static read-only
Im not clear with difference between static variable, const variable read-only variable and static readonly variable. Is there is any logical difference between them.
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Mahesh ChandRank #1 · 393.4K pointsPosted Jul 9, 2006, 9:48 AM EDT
Non Static - Each object has it's own memory space. This is like each guy has it's own cigar ;-)
Static class - The entire class is static, means has a single memory space allocated for it.
Read-only - Can not modify the value of the member. Can read it only.
Const - It's a variable you can not modify. They are used to give a better readable name to a constant value.
Static read-only - Static + read only ;)
Hope it helps.