Skip to main content

Posts

Showing posts from November, 2025
  Inheritance Inheritance can be defined as the process where one class acquires the properties (methods and fields) of another(parent). It is an important part of OOP. The class which inherits the properties of other is known as subclass (derived class, child class) and the class whose properties are inherited is known as superclass (base class, parent class). extends  is the keyword used to inherit the properties of a class. Following is the syntax of extends keyword. Syntax class Super {    ..... .... } class Sub extends Super {    .....    ..... } Types of Inheritance Java supports the following four types of inheritance: ○        Single Inheritance ○        Multi-level Inheritance ○        Hierarchical Inheritance ○        Hybrid Inheritance Single Inheritance In single inheritance, a sub-class is derived from only o...