Why do we need properties in c#?



Why do we need properties in c#?..

Answer / Hitesh Mishra

Properties in C# provide a simplified and user-friendly way to interact with private fields, enabling data encapsulation. They allow read-only or write-only access, validation of the setter or getter, and automatic generation of associated methods.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

Is object an int c#?

1 Answers  


What is verbatim literal in c#?

1 Answers  


What is parsing?

1 Answers  


What is a callback c#?

1 Answers  


Where are value types stored in c#?

1 Answers  


why C#.net doesnot support prcedures and why it supports structs,functions

1 Answers  


What is property c#?

1 Answers  


Which attribute is used in order that the method can be used as webservice?

1 Answers  


Trace the O/p for a program on inheritance and Polymorphism. 3 classes A,B,C A with two methods public virtual SomeMethodA public virtual SomemoreMethodA B:A overide virtual SomeMethodA C:B new Method SomeMethodA override SomeMoreMethodA main method { b new instance of B b.SomeMethodA b.SomeMoreMethodA b1 new instance of C b1.SomeMethodA b1.SomeMoreMethodA }

1 Answers  


How many aware interfaces are there?

1 Answers  


What is jit (just in time)?

1 Answers  


So let's say I have an application that uses myapp.dll assembly, version 1.0.0.0. There is a security bug in that assembly, and I publish the patch, issuing it under name myapp.dll 1.1.0.0. How do I tell the client applications that are already installed to start using this new myapp.dll?

1 Answers  


Categories