using System;
public class Program
{
public static void Main()
Person person = new Person();
Console.WriteLine(person.Name);
// uncomment the following line and review the error
//person.Name = "Jane";
}
public class Person
private string _name = "Jane";
// the Name property has different access modifiers for its getter and setter
public string Name
get
return _name;
private set
_name = value;
public void SetName()
// the Name property can still be set from within the class (because it's access modifier is private)
this.Name = "Jane";