static void Main(string[] args)
        {
            ISimple sim = new SimpleExample();

            sim.Create("Simple");

            IExample ex = new SimpleExample();

            ex.Create("Example");

            SimpleExample simEx = new SimpleExample();

            simEx.Create("Simple and Example");
        }
Exemple #2
0
        static void Main(string[] args)
        {
            IExample ex = new SimpleExample();

            ex.Create();

            ISimple sim = new SimpleExample();

            sim.Create();

            SimpleExample exSim = new SimpleExample();

            exSim.Create();
        }
        static void Main(string[] args)
        {
            //firstExample();
            //IParty party = new PhaniParty();
            //birthdayParty(party);

            ISimple sim = new SimpleExample();
            sim.Create();

            IExample ex = new SimpleExample();
            ex.Create();

            SimpleExample simEx = new SimpleExample();
            simEx.Create();
        }
        static void Main(string[] args)
        {
            //SimpleExample simEx = new SimpleExample();
            //simEx.SimpleFunc();
            //simEx.ExampleFunc();

            //using Runtime polmorphism..
            IExample ex = new SimpleExample();

            ex.ExampleFunc();

            //ISimple sim = new SimpleExample();
            ISimple sim = (ISimple)ex;//UR object will be now behave like ISimple so that it retains the data U have set using the IExample object. In other words, U share the same object in the form of sim.

            sim.SimpleFunc();
        }