1
0
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:
Max Yankov
2013-08-17 16:03:35 +02:00
parent 541fd3fb06
commit 4295e85d60

View File

@@ -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.