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();
        }