Hi friends
can anybody defined the term property in C#. what is the use of property in our project (asp.net)?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Jan 5, 2012, 3:08 AM
Properties provide the opportunity to protect a field in a class by reading and writing to it through the property. In other languages, this is often accomplished by programs implementing specialized getter and setter methods. C# properties enable this type of protection while also letting you access the property just like it was a field.
Another benefit of properties over fields is that you can change their internal implementation over time. With a public field, the underlying data type must always be the same because calling code depends on the field being the same. However, with a property, you can change the implementation.
http://dotnetguts.blogspot.com/2007/07/advantage-of-using-properties.html
http://csharpindepth.com/articles/chapter8/propertiesmatter.aspx
hope this help.
VulpesPosted Jan 2, 2012, 1:05 PM
Under the hood, the get and set accessors of a property are simply methods. Some object oriented languages such as C++ or Java don't support properties as such but can simulate them by defining accessor methods.
Satyapriya NayakPosted Jan 2, 2012, 12:06 PM
Please refer the below link
http://www.csharp-station.com/Tutorials/Lesson10.aspx
http://dotnetguts.blogspot.com/2007/07/advantage-of-using-properties.html
Thanks