overriding supports polyorphism
Define overriding. Explain it with an example
Overriding is done in a child class for a method that is written in the parent class. To override a method a new method is defined in the child class with exactly the same signature as the one in the parent class. Due to this the functionality of the parent class becomes inaccessible
No comments:
Post a Comment