using System;
public class Program
{
public static void Main()
// create an instance of Person passing a string to the constructor
Person smith = new Person("Captain Smith");
// display the person name
Console.WriteLine(smith.Name);
// create a second instance of the person class using the parameterless constructor
Person kirk = new Person();
Console.WriteLine(kirk.Name);
}
public class Person
public string Name{get; private set;}
public Person()
Name = "Captain Kirk";
// Person class has a contructor that take a string and assigns it to the Name property (private setter)
public Person(string Name)
// Person is able to set the Name property beacause it is private
this.Name = Name;