by fredrik-j · 7y ago · 0 comments
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.
No comments yet.