Interviews2 answers
What are properties in C#?
2 Answers
if we want to use private variables one class in another class then we have to go for porperties
Nidadavole ChowdaryPosted Aug 5, 2013, 8:27 PM EDT
Properties are smart field in C#. Its a extension of fields or variable. By properties we can access our private variable as public manner. It will not allocate a memory but it will share a memory form fields or variable. Property has 3 types of Process.
1. Read(get)
2. Write(set)
3. Read and Write(get and set)
We can call Read and Write property as a Auto implemented Property.
Property has 2 types of Accessers.
1. get{}- It will return a value to the variable.
2. set{}- It will assign a value to the variable.
lavanya veerasamyPosted Jul 9, 2013, 4:44 AM EDT