
#7 Known is a drop! Inheritance in JAVA
Inheritance is a powerful object-oriented programming feature offered by Java. It is one of the four main pillars (core concepts) of OOP: Encapsulation, Inheritance, Polymorphism, and Abstraction. The technique of creating a new class by using an existing class functionality is called inheritance in Java. The existing class is called parent class (a more general class) and the new class is called child class (a more specialized class). The child class inherits data and behavior from the parent class. What is Is-A Relationship in Java? IS-A relationship in Java represents inheritance. It is implemented in Java using: the extends keyword for class inheritance, and (the implements keyword for interface implementation). Object Class _All the classes in Java extends the class java.lang.object by default . _This is one of the best example of an IS-A relationship in Java. This means Object is the root class of all the classes in Java. By default, every class is the subclass of Object either d
Continue reading on Dev.to Tutorial
Opens in a new tab




