Example #1
0
        static void Main(string[] args)
        {
            A a = new A();

            Console.WriteLine($"a.value1 : {a.value1}");
            //Console.WriteLine($"a.value2 : {a.value2}");

            B b = new B();

            Console.WriteLine($"b.value1 : {b.GetValue1()}");
            Console.WriteLine($"b.value2 : {b.GetValue2()}");

            var c = new A.C();

            Console.WriteLine($"c.value3 : {c.GetValue3()}");
        }
Example #2
0
        static void Main(string[] args)
        {
            A a = new A();

            Console.WriteLine($"a.value1 : {a.value1}");
            //Console.WriteLine($"a.value2 : {a.value2}"); // (에러) 객체에서 protected 멤버에 접근 불가

            B b = new B();

            Console.WriteLine($"b.GetValue1() : {b.GetValue1()}");
            Console.WriteLine($"b.GetValue2() : {b.GetValue2()}");

            var c = new A.C();

            Console.WriteLine($"c.GetValue3() : {c.GetValue3()}");
        }