Object oriented programming (OOP) is a core of Java. The four pillars of OOPS are polymorphism, encapsulation, abstraction, inheritance. 1]POLYMORPHISM:- Polymorphism the word itself tell many form. It means any entity behaves differently according to the situation. 2]INHERITANCE:- The process of creating new classes from already existing classes is called…