adspace


Why we use get set property in c#?

Answer Posted / Sandeep Tiwari

In C#, properties are used to provide a simpler syntax for accessing and modifying private fields. The get and set keywords allow developers to define the behavior of how a field can be retrieved (getter) or assigned a new value (setter). This can include validation, transformation, and encapsulation of data.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you inherit a class into other class in c#?

1002


Why can't we use a static class instead of singleton?

964


What is an abstract class c#?

981


What is expression tree in c#?

1008


Which namespaces are necessary to create a localized application?

1151


How to assign Null value to Var?

1074