static void Main(string[] args) { var person = new Person(); person.SetBirthDate(new DateTime(1987, 08, 04)); Console.WriteLine(person.GetBirthdate()); }
public static void Main(string[] args) { var person = new Person(); person.SetBirthDate(new DateTime(1979, 8, 29)); Console.WriteLine(person.GetBirthDate()); }
static void Main(string[] args) { var person = new Person(); person.SetBirthDate(new DateTime(1989, 5, 28)); Console.WriteLine(person.GetBirthDate()); Console.ReadKey(); }
static void Main(string[] args) { var person = new Person(); //cant see person.birthday with person.birth... //use set / get person.SetBirthDate(new DateTime(1982, 9, 9)); var birthDate = person.GetBirthDate(); Console.WriteLine(birthDate); }
static void Main(string[] args) { var person = new Person(); person.SetBirthDate(new DateTime(1982, 1, 1)); Console.WriteLine(person.GetBirthDate()); // Why use private when we needed to create two functions // in order to get/set the birthdate? // Answer: This is a stupid example, but some things are implementation // details, and should be hidden from the outside world. }