I want to call FamilyCar method Move(). If FamilyCar is a LandVehicle, I want to call LandVehicle Move() method at the same time. I'm looking for very basic way to do it.
Base class
class LandVehicle : Vehicle { public override string Move() { return "Move on the wheels"; } } Subclass
class FamilyCar : LandVehicle { public override string Move() { return "Pip pip!"; } }
base.Move()inFamilyCar.Move()?base.Move()to call the parent'smovefunction. Of course you can'treturntwice so you have to refactor that part.