Posts

Showing posts from June, 2021

Inheritance in OOPS | C++ | JAVA | C++ v/s JAVA

Image
 INTRODUCTION What is Inheritance? One can say general meaning of inheritance is the common term for getting some heritage or habits from your parents of fore parents.  E.g. When a person receive property or blood group from his parents it is called as inheritance. Where as in Object Oriented Programming, Inheritance is a condition when  an object or class upon another object or class, retaining the similar implementation. Also defined as deriving new class from existing one such as base class and then forming them into hierarchy of classes. What is Base-Class and Sub-Class? The class whose properties are inherited is called as Super-Class (Base-Class or Parent-Class). And the class who inherits the properties from different classes is called as Sub-Class(Derived-Class or Child-Class). Why do we use Inheritance? With Inheritance, we can reuse the fields and methods of the existing class in different classes with different parameters. Hence inheritance gives facility of Re...