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

            aa.IAAPrint();

            BB bb = new BB();

            bb.IAAPrint();
            bb.IBBPrint();

            IAA iaa = new AA(); //참조 가능

            iaa.IAAPrint();

            IBB ibb = bb as IBB;

            ibb.IBBPrint();

            CC cc = new CC();

            cc.Print();
            cc.IAAPrint();
            cc.IBBPrint();


            Super scc = cc as Super;

            scc.Print();

            IAA iaacc = cc as IAA;

            iaacc.IAAPrint();

            IBB ibbcc = cc as IBB;

            ibbcc.IBBPrint();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            AA aa = new AA();

            aa.IAAPrint();

            BB bb = new BB();

            bb.IAAPrint();
            bb.IBBPrint();

            IAA Iaa = new AA();

            Iaa.IAAPrint();

            IBB Ibb = bb as IBB;

            Ibb.IBBPrint();

            CC cc = new CC();

            cc.Print();
            cc.IAAPrint();
            cc.IBBPrint();

            Super sCC = cc as Super;

            sCC.Print();

            IAA IAAcc = cc as IAA;

            IAAcc.IAAPrint();

            IBB IBBcc = cc as IBB;

            IBBcc.IBBPrint();
        }