mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
C#: Auto-implemented properties
This commit is contained in:
parent
541fd3fb06
commit
4295e85d60
@ -480,13 +480,13 @@ namespace Learning
|
||||
set { _hasTassles = value; }
|
||||
}
|
||||
|
||||
private int _frameSize;
|
||||
// Properties can be auto-implemented
|
||||
public int FrameSize
|
||||
{
|
||||
get { return _frameSize; }
|
||||
get;
|
||||
// you are able to specify access modifiers for either get or set
|
||||
// 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.
|
||||
|
Loading…
Reference in New Issue
Block a user