0
C# getter setter
In C# codes, it's write : get { return varName; } set { varName = value; } why the "get" is before the "set" if we set the value first (with set) and then return it (with get) ?
2 ответов
+ 3
It doesn't matter which is before which.
If you want to GET the value, GET is called.
If you want to SET the value, SET is called.
Order doesn't matter.
0
Thank you, now I get it