Exemplo n.º 1
0
        static void Main(string[] args)
        {
            NameCard2 n2 = new NameCard2();

            n2.Name = "장만월";
            Console.WriteLine(n2.Name);
            Console.WriteLine(n2.PhoneNum);
            Console.WriteLine();

            NameCard3 n3 = new NameCard3();

            Console.WriteLine(n3.Name);
            Console.WriteLine(n3.PhoneNum);
            Console.WriteLine();

            NameCard1 n1 = new NameCard1()
            {
                Name     = "아이유",
                PhoneNum = "010-123-4567"
            };

            Console.WriteLine(n1.Name);
            Console.WriteLine(n1.PhoneNum);
            Console.WriteLine();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            NameCard1 n1 = new NameCard1();

            n1.Name = "박보검";
            Console.WriteLine(n1.Name);

            NameCard2 n2 = new NameCard2();

            n2.Name = "장만월";
            Console.WriteLine(n2.Name);

            NameCard3 n3 = new NameCard3();

            Console.WriteLine(n3.Name);

            NameCard2 n4 = new NameCard2()
            {
                Name        = "아이유",
                PhoneNumber = "010-111-2222"
            };

            Console.WriteLine(n4.Name);
        }