Because every instance of the subclass still needs to be a valid instance of the base class (see Liskov substitution principle).
If the subclass suddenly has lost one property of the base class (namely a public method for example) then it would no longer be a valid substitute for the base class.
More Related Contents:
- Polymorphism vs Overriding vs Overloading
- What is the difference between dynamic and static polymorphism in Java?
- Polymorphism with instance variables [duplicate]
- How do I correctly implement this code segment without getting a logic error? [closed]
- What issues should be considered when overriding equals and hashCode in Java?
- Overriding the java equals() method – not working?
- Override back button to act like home button
- Can overridden methods differ in return type?
- Polymorphism: Why use “List list = new ArrayList” instead of “ArrayList list = new ArrayList”? [duplicate]
- How to override equals method in Java
- Overriding vs Hiding Java – Confused
- If you overwrite a field in a subclass of a class, the subclass has two fields with the same name(and different type)?
- Does polymorphism apply on class attributes in Java?
- Can java call parent overridden method in other objects but not subtype?
- How to call the overridden method of a superclass?
- The connection between ‘System.out.println()’ and ‘toString()’ in Java
- How to quickly determine if a method is overridden in Java
- Superclass reference not able to call subclass method in Java
- Java: Calling a super method which calls an overridden method
- How does Java Object casting work behind the scene? [duplicate]
- What is the benefit of polymorphism using Collection interface to create ArrayList object?
- Why doesn’t the compiler complain when I try to override a static method?
- Why are contravariant parameter types in Java not allowed for overriding?
- In Java, how do I call a base class’s method from the overriding method in a derived class?
- Polymorphism in jackson annotations: @JsonTypeInfo usage
- Higher-kinded generics in Java
- Why do we have to call super in Android sometimes?
- Java getMethod with subclass parameter
- Overriding a method with different return types in java?
- How does one use polymorphism instead of instanceof? (And why?)