Why we use get set property in c#?



Why we use get set property in c#?..

Answer / 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

More C Sharp Interview Questions

What is event and delegates in c#?

1 Answers  


What is the difference between ienumerable and icollection?

1 Answers  


Can scriptable objects have methods?

1 Answers  


What is the difference between arraylist and list in c#?

1 Answers  


What is Abstraction?

8 Answers   Google, HCL, IBM, MAHINDRA, Tech Mahindra,


What is the difference between “finalize” and “finally” methods in c#?

1 Answers  


Explain the importance and use of each, version, culture and publickeytoken for an assembly.

1 Answers  


What does it meant to say “the canonical” form of XML ?

1 Answers  


What is session state in asp net c# with example?

1 Answers  


How you will create satellite assemblies?

1 Answers  


How many types of serialization are there in c#?

1 Answers  


Is lazy thread safe c#?

1 Answers  


Categories