What are accessors?
All Answers
need an explanation for this answer? contact us directly to get an explanation for this answer
The get and set portions or blocks of a property are called accessors. These are useful to restrict the accessibility of a property. The set accessor specifies that we can assign a value to a private field in a property. Without the set accessor property, it is like a read-only field. With the ‘get’ accessor we can access the value of the private field. In other words, it returns a single value. A Get accessor specifies that we can access the value of a field publically.
We have three types of properties: Read/Write, ReadOnly, and write-only.
need an explanation for this answer? contact us directly to get an explanation for this answer
total answers (1)

c# programming