CARFAX Interview Question

Explain class inheritance and how polymorphism fits into it.

Interview Answer

Anonymous

Jul 27, 2018

Polymorphism divides into two 1) overloading 2) overriding and inheritance is a instance between parent class and child class So when we are extending the parent class from subclass, parent class inherit its values to child class. In that process, if there are methods with same name and different parameters, then overloading occurs. If there are methods with same name and same parameters, then overriding occurs..!

1