mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-01 04:20:39 +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,
|
||||
string name, bool hasCardsInSpokes)
|
||||
{
|
||||
this.gear = startGear;
|
||||
this.gear = startGear; // "this" keyword denotes the current object
|
||||
this.cadence = startCadence;
|
||||
this._speed = startSpeed;
|
||||
this.name = name;
|
||||
this.name = name; // it can be useful when there's a name conflict
|
||||
this.hasCardsInSpokes = hasCardsInSpokes;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user