static void print_02() { Car car = new Car(); Plane plane = new Plane(); FlyingCar flyingcar = new FlyingCar(); car.Run(); plane.Fly(); flyingcar.Run(); flyingcar.Fly(); }
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(); }
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(); }
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}"); }