Get and set accessors do they protect different instances of a variable?
Posted
by
Chris Halcrow
on Programmers
See other posts from Programmers
or by Chris Halcrow
Published on 2012-10-29T20:58:02Z
Indexed on
2012/10/29
23:19 UTC
Read the original article
Hit count: 211
The standard method of implementing get and set accessors in C# and VB.NET is to use a public property to set and retrieve the value of a corresponding private variable. Am I right in saying that this has no effect of different instances of a variable? By this I mean, if there are different instantiations of an object, then those instances and their properties are completely independent right? So I think my understanding is correct that setting a private variable is just a construct to be able to implement the get and set pattern? Never been 100% sure about this.
© Programmers or respective owner