mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-24 01:51:38 +00:00
C#: comments about "this" keyword
This commit is contained in:
parent
4295e85d60
commit
c3df13db56
@ -422,10 +422,10 @@ namespace Learning
|
|||||||
public Bicycle(int startCadence, int startSpeed, int startGear,
|
public Bicycle(int startCadence, int startSpeed, int startGear,
|
||||||
string name, bool hasCardsInSpokes)
|
string name, bool hasCardsInSpokes)
|
||||||
{
|
{
|
||||||
this.gear = startGear;
|
this.gear = startGear; // "this" keyword denotes the current object
|
||||||
this.cadence = startCadence;
|
this.cadence = startCadence;
|
||||||
this._speed = startSpeed;
|
this._speed = startSpeed;
|
||||||
this.name = name;
|
this.name = name; // it can be useful when there's a name conflict
|
||||||
this.hasCardsInSpokes = hasCardsInSpokes;
|
this.hasCardsInSpokes = hasCardsInSpokes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user