Author: prodevelopertutorial
Follow this blog to learn more about C, C++, Linux, Competitive Programming concepts, Data Structures.
Poly means many, morphism means forms. Polymorphism in C++means one function behaving differently under different situations. There are 2 types of polymorphism, namely: Compile time polymorphism Function overloading Operator overloading Function overriding Run time polymorphism Virtual functions Explicit and Implicit casting 1. Compile time polymorphism: …
Below are different types of inheritance: Single Inheritance Multiple Inheritance Multilevel Inheritance Hierarchical Inheritance Hybrid Inheritance Multipath Inheritance / Diamond Problem Accessibility in Inheritance 1. Single Inheritance In this type of inheritance, there will be only 1 base class, and one derived class. It can …
In. this tutorial we shall learn about below topics: Introduction Deriving by different access specifiers: C++ Base class Pointer and Derived class pointer. Virtual Base Class Constructor and Destructor calls in Inheritance Constructor and Destructor calls in Multiple Inheritance Pointers and Inheritance 1. Introduction …
In this tutorial we shall learn about below different types of Constructors: Default Constructor Parameterized constructors Overloading constructors Constructor with default arguments 1. Default constructor: A constructor that does not take any arguments is called as default constructor. When an object is created default constructor …
In this chapter we shall look at below topics Introduction Constructor and its properties Destructor and its properties 1. Introduction In the previous chapter we have seen, to initialize the data members we used a helper method like “setters” and “getters” after creating an object. …