예제 #1
0
파일: Program.cs 프로젝트: Organwolf/Udemy
        static void Main(string[] args)
        {
            var person = new Person();

            person.SetBirthDate(new DateTime(1987, 08, 04));
            Console.WriteLine(person.GetBirthdate());
        }
예제 #2
0
        public static void Main(string[] args)
        {
            var person = new Person();

            person.SetBirthDate(new DateTime(1979, 8, 29));
            Console.WriteLine(person.GetBirthDate());
        }
예제 #3
0
        static void Main(string[] args)
        {
            var person = new  Person();

            person.SetBirthDate(new DateTime(1989, 5, 28));
            Console.WriteLine(person.GetBirthDate());
            Console.ReadKey();
        }
예제 #4
0
        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.
        }