from time to time, I see some sample code that is handed to me that has a code snippet that looks like this:
- public string Name { get; set; }
Does this actually do anything? Does it really make it so that one can set and get the "Name" string variable?
I have always thought that what is required is something like this:
- private string name;
-
- public string Name
- {
- get
- {
- return this.name;
- }
- set
- {
- this.name = value;
- }
- }
Am I correct?
Please advise.