Hacker News new | ask | show | jobs
by fredrik-j 2426 days ago
If an extending class does not implement a method which is implemented by its super class, a call to that method on a instance of the extending class will invoke the super class' implementation of the method.

The super class implementation of the method may perform something that is entirely correct even for the extended class, or it may do something that is inconsistent with the assumptions of the extended class. Either way, there is no way for the compiler or runtime to determine if the omission of the method in the extending class is intentional or a mistake.

This is one reason to prefer Composition over Inheritance, especially in Java.