What is Property
| A property is a thing that describes the features of an object. A property is a piece of data contained within class that has an exposed interface for reading/writing. Looking at that definition, you might think you could declare a public variable in a class and call it a property. While this assumption is somewhat valid, the true technical term for a public variable in a class is a field. The key difference between a field and a property is in the inclus | |
| ion of an interface.
We make use of Get and Set keywords while working with properties. We prefix the variables used within this code block with an underscore. Value is a keyword, that holds the value which is being retrieved or set. Private _Color As StringPublic Property Color() GetReturn _Color End GetSet(ByVal Value) _Color = ValueEnd Set End Property | |
