polymorphism means one object can take multiple forms. lets explain this using a method poly() in java class.
One class in Java can get the methods and properties from other class – this helps reducing the coding efforts , increase code reusability and maintainability.
in the above Java code, classB class gets the methods and properties from classA class.
// so we are able to write obj1.add() from father.