Exemplo n.º 1
0
        static void Main(string[] args)
        {
            BaseClass cls = new DerrivedClass();

            cls = null;
            GC.Collect();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            BaseClass         myObj   = new BaseClass();
            DerrivedClass     derObj1 = (DerrivedClass)myObj;
            NextDerrivedClass NxtObj1 = new NextDerrivedClass();

            myObj = NxtObj1;
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            BaseClass myObj = new BaseClass();
            //   DerrivedClass derObj1 = (DerrivedClass)myObj;
            //    NextDerrivedClass NxtObj1 = (NextDerrivedClass)myObj;
            DerrivedClass derObj1 = new DerrivedClass();

            //Z podklasy do nadklasy mozna. z nadklasy do podklasy juz nie.


            Console.ReadKey();
        }