Object Oriented Programming
How to Code Inheritance in Java — Beginner’s Tutorial in OOP
Let’s understand the concept of ‘inheritance’ in object oriented programming
Published in
4 min readJan 10, 2020
Webster’s online dictionary defines inheritance as the acquisition of a possession, condition, or trait from past generations. In object oriented design inheritance has a similar (not exactly the same) connotation. Inheritance means
- Organising classes in a hierarchy
- Higher hierarchy inherits properties from lower hierarchy
- Clubbing similar things into the same class
- Classes go from general to specific as you go higher in hierarchy
This means that the most basic class, also known as the base class, will be the most general one. It is also known as the parent class or the super-class. For example ‘electronics’ is the base class and its child class will be ‘mobile phones’ or ‘sound systems’.