1 Explain Inheritance in Java?
Inheritance is one of the most important pillars of the OOPs (Object Oriented programming system). Inheritance in Java is a mechanism by which one class acquires all the properties and behaviors of another class. The class from which the subclass is derived is known as the superclass (also a base class or a parent class). The idea behind inheritance in Java is that you can create subclasses that are built upon existing superclasses. When a class is derived from an existing class, you can reuse methods and fields of the superclass in it. Moreover, you can add new methods and fields in the subclass also. Inheritance represents the parent-child relationship which is also known as an IS-A relationship. In other words, You can say that the class from which another class acquires the properties and behavior is known as the superclass(sometimes base class or parent class). The class that acquires the properties and behavior of an existing superclass is known as the subclass(sometimes derived class or child class).