예제 #1
0
파일: Program.cs 프로젝트: Cass9/PiotrM
        static void Main(string[] args)
        {
            Car     car1     = new Car();
            Bicycle bicycle1 = new Bicycle();

            IRideable rideCar = car1;

            rideCar.Ride();

            IRideable rideBicycle = bicycle1;

            rideBicycle.Ride();

            Osoba os1 = new Osoba();

            os1.Graj();

            IGitarzysta gitaraOs1 = os1;

            gitaraOs1.Graj();

            ISkrzypek skrzypceOs1 = os1;

            skrzypceOs1.Graj();



            Console.ReadKey();
        }
예제 #2
0
        static void Main(string[] args)
        {
            Car     car1     = new Car();
            Bicycle bicycle1 = new Bicycle();

            car1.Ride();
            bicycle1.Ride();

            Osoba       osoba1     = new Osoba();
            IGitarzysta gitarzysta = osoba1;
            ISkrzypek   skrzypek   = osoba1;

            osoba1.Graj();
            gitarzysta.Graj();
            skrzypek.Graj();
            Console.ReadKey();
        }