The advantages of using properties are:
• Before allowing a change in data, the properties can validate the data.
• Properties can evidently make visible of data on a class from where that data is actually retrieved such as a database.
• Properties can also provide events when data is changed, such as raising an event or changing the value of other fields.
Asked In: Many Interviews |