コード例 #1
0
        static void print_02()
        {
            Car       car       = new Car();
            Plane     plane     = new Plane();
            FlyingCar flyingcar = new FlyingCar();

            car.Run();
            plane.Fly();
            flyingcar.Run();
            flyingcar.Fly();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: JBD-developer/CSharp
        static void Main(string[] args)
        {
            FlyingCar clsCar = new FlyingCar();

            clsCar.Fly();
            clsCar.Run();

            IRunnable iRunable = clsCar as IRunnable;

            iRunable.Run();

            IFlyable iFlyable = clsCar as IFlyable;

            iFlyable.Fly();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: goodluck3586/CSharp
    static void Main(string[] args)
    {
        FlyingCar car = new FlyingCar();

        car.Run();
        car.Fly();

        IRunnable runnable = car as IRunnable;

        runnable.Run();

        IFlyable flyable = car as IFlyable;

        flyable.Fly();
    }
コード例 #4
0
ファイル: Program.cs プロジェクト: am1752/StudyCSharpp
        static void Main(string[] args)
        {
            FlyingCar car = new FlyingCar();

            car.Run();
            car.Fly();

            IRunnable runnable = car as IRunnable;

            runnable.Run();

            IFlyable flyable = car as IFlyable;

            flyable.Fly();

            car.Company    = "Naver";
            car.HorsePower = 12.4f;
            car.Year       = 1234;
            WriteLine($"{car.Company} {car.HorsePower} {car.Year}");
        }