Get:
The get { } implementation must include a return statement. It can access any member on the class.
Set:
The set { } implementation receives the implicit argument 'value', which is the value to which the property is assigned.
using System;
class Example
{
int _number;
public int Number
{
get
{
return this._number;
}
set
{
this._number = value;
}
}
}
If u had any trouble just ask, Happy to help u :)
Stay Tune... Have a nice day... 'N happy Coding :)
The get { } implementation must include a return statement. It can access any member on the class.
Set:
The set { } implementation receives the implicit argument 'value', which is the value to which the property is assigned.
using System;
class Example
{
int _number;
public int Number
{
get
{
return this._number;
}
set
{
this._number = value;
}
}
}
If u had any trouble just ask, Happy to help u :)
Stay Tune... Have a nice day... 'N happy Coding :)
No comments:
Post a Comment