1.

Explain The 3 Types Of Properties In C# With An Example?

Answer»

1. Read Only PROPERTIES: Properties WITHOUT a set accessor are considered read-only. In the above example FullName is read only property.
2. WRITE Only Properties: Properties without a GET accessor are considered write-only. In the above example COUNTRY is write only property.
3. Read Write Properties: Properties with both a get and set accessor are considered read-write properties. In the above example FirstName and LastName are read write properties.

1. Read Only Properties: Properties without a set accessor are considered read-only. In the above example FullName is read only property.
2. Write Only Properties: Properties without a get accessor are considered write-only. In the above example Country is write only property.
3. Read Write Properties: Properties with both a get and set accessor are considered read-write properties. In the above example FirstName and LastName are read write properties.



Discussion

No Comment Found