EDIT:
To be clear: The fact that the design is quite ugly is not the point. The point is, that the design is there and I am in the situation to have to add another sub-c
Brother, study Interfaces too.
If you want some class, such as Vehicle
to only provide function prototypes, then you should always use Interface.
And make your FlyingMotorizedVehicle
as abstract class.
For further study, you can find many useful links, including this one.
=============================CODE-EXAMPLE=======================================
For Vehicle
public interface Vehicle {
Something doStuff(...);
SomethingElse doOtherStuff(...);
Foo bar(...);
}
For FlyingMotorizedVehicle
public abstract class FlyingMotorizedVehicle extends MotorizedVehicle {
SomethingElse doOtherStuff(...) {
return new SomethingElse();
}
}
===============================================================================
Happy OOP-ing!