mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-06 06:47:54 +02:00
C#: comments about "this" keyword
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user