mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +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,
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user