Why we use get set in c#?



Why we use get set in c#?..

Answer / Anuj Kumar Kanchan

Getters (properties with a get keyword) and Setters (properties with a set keyword) are used in C# to provide controlled access to private fields. They encapsulate the object's state, making it more secure and easier to manage.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

What is difference between arraylist and list in c#?

1 Answers  


What is the difference between firstordefault and first?

1 Answers  


Explain about Oops concept

1 Answers   Digital GlobalSoft,


What is the use of console readkey ()?

1 Answers  


What does == mean in c sharp?

1 Answers  


What is the root element of an xml file?

1 Answers  


What is difference between function and method in c#?

1 Answers  


Is post back c#?

1 Answers  


Why multiple inheritance is not possible in c#

8 Answers  


Describe the parts of assembly.

1 Answers  


what is the fastest way to concatenate strings in c sharp?

4 Answers   HCL,


Is it possible to have a static indexer in c#? Allowed in c#.

1 Answers  


Categories