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.

Gajanan ChavhanPosted Jul 2, 2018, 3:39 AM
Rafnas T PPosted Jun 29, 2018, 9:36 PM
James AxsomPosted Jun 29, 2018, 6:33 PM
Tushar DikshitPosted Jun 29, 2018, 3:15 PM