- C# provides a concept called properties to enable to create object oriented fields within the classes.
- Properties use the keywords get and set to get the values from the variables and set the values in the variables.
- Syntax:
get
{
return variable;
}
set
{
variable = value;
}
- E.g.: public int iPointy1
{
get
{
return iPointy;
}
set
{
iPointy = value;
}
}
Properties
Subscribe to:
Post Comments
(
Atom
)
0 comments :
Post a Comment