Subclasses provide specific implementations of superclass methods.
Overriding allows a subclass to offer a specific implementation for a method already defined in its superclass. For example, a 'Product' class might have a method 'display()'. A 'Book' subclass can override this method to display specific book details. The overridden method in the subclass is invoked, even if the object is referenced as the superclass type.
Additional Notes
How does method overriding work?
Track: Java
Topic: Core Java
Focus: Code Reading with Related Types
Topics:Code Reading with Related TypesCore JavaJava