In C#, a property is a way to expose an internal data element of a class
in a simple and intuitive manner. In other words, it is a simple
extension of data fields. You can create a property by defining an
externally available name and then writing the set and get
property accessors. The get property accessor is used to return the
property value. The set property accessor is used to assign a new value
to the property.
Syntax:-
public Return-type Data_field { get; set; }
Syntax:-
public Return-type Data_field { get; set; }
No comments:
Post a Comment