Super Keyword in Java

Super refer to parent class. It holds the reference id of parent section of child class object. Observe below example. class A {                 int x=10; } class B extends A {                 int x=20; } Here you can see that in child object, two separate sections are created namely parent section and child section. …

Super Keyword in Java Read More »

Inheritance in Java

Creating a new class from existing class is known as inheritance. Inheritance is used to achieve dynamic binding and reusability. The class which is inherited is known as super class or parent class and the class derived from the parent class is known as sub class or child class. Inheritance is implemented using extends keyword. …

Inheritance in Java Read More »