mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-18 20:41:29 +02:00
C#: Auto-implemented properties
This commit is contained in:
@@ -480,13 +480,13 @@ namespace Learning
|
|||||||
set { _hasTassles = value; }
|
set { _hasTassles = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private int _frameSize;
|
// Properties can be auto-implemented
|
||||||
public int FrameSize
|
public int FrameSize
|
||||||
{
|
{
|
||||||
get { return _frameSize; }
|
get;
|
||||||
// you are able to specify access modifiers for either get or set
|
// you are able to specify access modifiers for either get or set
|
||||||
// this means only Bicycle class can call set on Framesize
|
// this means only Bicycle class can call set on Framesize
|
||||||
private set { _frameSize = value; }
|
private set;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Method to display the attribute values of this Object.
|
//Method to display the attribute values of this Object.
|
||||||
|
Reference in New Issue
Block a user