mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-11-27 13:32:56 +03:00
commit
017d6060d4
@ -558,7 +558,7 @@ on a new line! ""Wow!"", the masses cried";
|
|||||||
}
|
}
|
||||||
set // set - define a method to set a proprety
|
set // set - define a method to set a proprety
|
||||||
{
|
{
|
||||||
_cadence = value; // Value is the value passed in to to the setter
|
_cadence = value; // Value is the value passed in to the setter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private int _cadence;
|
private int _cadence;
|
||||||
@ -576,7 +576,7 @@ on a new line! ""Wow!"", the masses cried";
|
|||||||
}
|
}
|
||||||
|
|
||||||
int _speed; // Everything is private by default: Only accessible from within this class.
|
int _speed; // Everything is private by default: Only accessible from within this class.
|
||||||
// can also use keyword privatee
|
// can also use keyword private
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
// Enum is a value type that consists of a set of named constants
|
// Enum is a value type that consists of a set of named constants
|
||||||
@ -608,7 +608,7 @@ on a new line! ""Wow!"", the masses cried";
|
|||||||
// This is a default constructor
|
// This is a default constructor
|
||||||
public Bicycle()
|
public Bicycle()
|
||||||
{
|
{
|
||||||
this.Gear = 1; // you can access mmebers of the object with the keyword this
|
this.Gear = 1; // you can access members of the object with the keyword this
|
||||||
Cadence = 50; // but you don't always need it
|
Cadence = 50; // but you don't always need it
|
||||||
_speed = 5;
|
_speed = 5;
|
||||||
Name = "Bontrager";
|
Name = "Bontrager";
|
||||||
|
Loading…
Reference in New Issue
Block a user