Series: Inheritance

Java Inheritance concepts

Types of Inheritance Tutorial Java

Types of Inheritance There exists basically three types of inheritance. Multilevel inheritance Multiple inheritance Hierarchical inheritance 1. In single inheritance, one class extends one class only. In multilevel inheritance, the ladder of single inheritance increases. 2. In multiple inheritance, one class directly extends more than one class. 3. In hierarchical inheritance one class is extended …

Types of Inheritance Tutorial Java Read More »

Extends Java Multiple classes

Extends Java An OOPs language is meant more for reusability. It achieves reusability with "has-a" relation (through composition) and "is-a" relation (through inheritance). For "has-a" relationship, known as composition in Java, refer Composition – "has-a" Relationship. Now let us discuss inheritance and how the reusability is achieved. To get the concept, very small programs are …

Extends Java Multiple classes Read More »

Java Made Clear: Difference between this and super Example

Basically, both this vs super Java are keywords performing different jobs. this keyword refers an object super keyword refers a super class variable or method A) Meaning, Purpose and Usage of this Keyword this refers an object, that too, a current object. What is current object? To understand better, let us write a small program …

Java Made Clear: Difference between this and super Example Read More »

final Keyword Java Examples Screenshots

final Keyword Java After going through "static" and "super" keywords, let us go another keyword "final". These three keywords, known as access modifiers, are used very often in Java code. The final keyword behaves very differently when applied to variables, methods and classes. Even though its functionality (purpose) is different in the three contexts, but …

final Keyword Java Examples Screenshots Read More »

Java Made Clear: Difference between static and final Keywords

static vs final java, both are known access modifiers in Java doing different functionalities (used for different jobs). static: static keyword can be applied to instance variables and methods but not to classes. When applied, variables and methods can be called without the help of an object. When a method or variable is called without …

Java Made Clear: Difference between static and final Keywords Read More »