Overview of Properties
Teacher starts the discussion: We already know that encapsulation is one of the key characteristics in object-oriented programming. In C#, properties are very important because they help encapsulate an object state. A property is a member that provides a flexible mechanism to read, write, or compute the value of a private field. Initially, properties may appear similar to fields, but actually they have either get or set or both blocks attached with them. These special blocks/methods are called
accessors
. In simple terms, get blocks ...