public Person(string firstName, string lastName, DateTime dateOfBirth)
DateOfBirth = dateOfBirth;
public string FirstName { get; set; }
public string LastName { get; set; }
public DateTime DateOfBirth { get; set; }
public string GetFullName()
return FirstName + " " + LastName;
return DateTime.Now.Year - DateOfBirth.Year;
public static void Main()
Person person = new Person("Tom", "Tim", new DateTime(1980, 12, 3));
Console.WriteLine(person.DateOfBirth);