C++ Tutorials | L48: Calling Parameterized Constructor in Inheritance | The Easy Concepts

preview_player
Показать описание
#programming #cplusplusprogramming #cprogramming
C++ Tutorials | L48: Calling Parameterized Constructor in Inheritance | The Easy Concepts

In this tutorial, we have discussed the concept of calling parameterized constructors in inheritance. In the previous tutorial, the order of the calling of constructors and destructors was discussed in detail with respect to inheritance. We also discussed an example code which makes it easy to understand the concept of variable access very quickly.

The class from which the new class inherits properties (data members and member functions) is called BASE CLASS and the newly created class is called DERIVED CLASS.

Syntax - class derived-class: access-specifier base-class1, access-specifier base-class2
{
// Body of the derived class
}

Please watch the full video to learn the concepts in more detail.

Learn Computer Science Concepts in an Easy Way !!

Рекомендации по теме
Комментарии
Автор

Function overloading means using same name of function with different signature.
Function overriding is using same function with same parameters while changing the code in that function.

kunalbandooni
Автор

Sir,
Function overloading means the function name should be same but must have different arguments i.e. either different num or different types (consisting different data types )...
But function overriding refers to the same function name having same arguments (or no arguments) present in different classes ... Function overriding only take place in inheritance.

divyanshbhatt
Автор

In Function overloading, we have more than one method, with same name but different parameter list.

function overriding is said to be occur in inheritance, when a method(function) in subclass has same name and same parameter list as of base class

vitaminprotein
Автор

Sir Function Overloading means using a function in different forms by passing different parameters to it.
For ex Area(5, 10) and Area(5)
But
Function Overriding means making the same name function in the derrived class so that it replaces the original function of the base class unless the base function is called explicitly.

kanakmittal
Автор

Function overloading means two or more functions can have the same name but different signatures within a class and they can perform a similar type of operation with a different number of arguments. While function overriding means two or more functions having exactly the same name and signature in two different inherited classes(e.g one in the parent class and one in child class), then the function in the child/derived class will override the function of the parent class and can perform a totally different task(i.e. the function in the parent class will be hidden). Function overloading can happen in the same class but function overriding can only take place in inherited classes.

aakarshverma
Автор

Function Overloading provides multiple definitions of the function by changing signature i.e. changing number of parameters or changing datatype of parameters.
Function Overriding is the redefinition of base class function in its derived class with same signature i.e. parameters.

shraddhamarkandey
Автор

8:06 but we were expecting derived class's print() function to print value 20, aren't we?

prashantchavan
welcome to shbcf.ru