Q:

What are accessors?

0

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# Interview Questions and Answers,You Need To Know

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
What are the differences between System.String and... >>
<< What are Properties in C#?...