Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var person = new Person();

            person.SetBirthdate(new DateTime(1975, 9, 11));
            System.Console.WriteLine(person.GerBirthdate());


            var person2 = new Person2();

            person2.Birthdate = new DateTime(1976, 3, 17);
            System.Console.WriteLine(person2.Age);
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            var person1 = new Person1();

            person1.SetBirthdate(new DateTime(1986, 3, 25));
            Console.WriteLine(person1.GetDate());

            var person2 = new Person2 {
                Birthdate = new DateTime(1989, 4, 1)
            };

            Console.WriteLine(person2.Birthdate);

            var person3 = new Person3 {
                Birthdate = new DateTime(1985, 12, 4)
            };

            Console.WriteLine(person3.Birthdate);
            Console.WriteLine(person3.Age);
        }