This sample code is from MSDN.
private string name;
public string Name
{
get
{
return name;
}
set
{
name = value;
}
}
I looked several examples, and they are the same. Why do we keep two different properties to store the name, namely "name" and "Name".
I mean, why don't we write the code like this?
public string Name
{
get
{
return Name;
}
set
{
Name= value;
}
}