Ejemplo n.º 1
0
        static void Main()
        {
            SecondDerived derived = new SecondDerived();  // Use SecondDerived.
            MyBaseClass   mybc    = (MyBaseClass)derived; // Use MyBaseClass.

            derived.Print();
            mybc.Print();
        }
Ejemplo n.º 2
0
        static void Main()
        {
            MyDerivedClass derived = new MyDerivedClass();
            MyBaseClass    mybc    = (MyBaseClass)derived;

            derived.Print();        // Call Print from derived portion.
            mybc.Print();           // Call Print from base portion.
        }
Ejemplo n.º 3
0
        static void Main()
        {
            MyDerivedClass derived = new MyDerivedClass();
            MyBaseClass    mybc    = (MyBaseClass)derived;

            derived.Print();
            mybc.Print();
        }
Ejemplo n.º 4
0
        static void Main()
        {
            MyDerivedClass derived = new MyDerivedClass();
            MyBaseClass    mybc    = (MyBaseClass)derived;

            Console.WriteLine(derived.MyProperty);
            Console.WriteLine(mybc.MyProperty);
        }