Тёмный
No video :(

30 Multiple Inheritance in C++ zoom | C++ Programming Tutorial for beginners | cpp | C plus plus 

tech fort
Подписаться 10 тыс.
Просмотров 21
50% 1

#Inheritance in C ++ :
- inheritance is nothing but accessing one class properties(data members and member functions) into another class.
- Inheritance is the process in which one object acquires all the properties(data members) and behaviors(member functions) of its parent object automatically.
- child/derived/sub class
- parent/base/super class :
- The class which inherits the members/properties of another class is called as child/derived/sub class, and the class whose members/properties are inherited is called as base/parent/super class.
Advantages: Code Re usability
class SuperClass{
//body
}
Derived Class:
A derived class is defined as the class derived from the base class.
class DerivedClass::visibility_mode SuperClass{
// body of child/derived class
}
DerivedClassname :
visibility_mode : access spefiers
Note:
- When the base class is privately inherited by the derived class, public members of the base class becomes private members of the derived class. therefore the public memebers of the base class are not accesible by the objects of derived class, so derived/sub class objects by can access the members of its own class only.
- When the base class is publicly inherited by the derived/child/sub class, public members of the base class also becomes public members of the child/derived class. therefore public members of the base class are accessible by the objects of the derived/sub class as well as by the members functions of the base class also.
- Note : default mode of visiblity is private.
- private members of the base class never be inherited.
Types of ineritance:
--------------------
Single inheritance
Multiple inheritance
hierarchical
multilevel inheritance
hybrid inheritance
1)Single inheritance:
--------------------
Single inheritance in which a derived class is inherited form only one base/parent class
2) Multiple inheritance:
------------------------
Multiple inheritance is the process deriving a class from another derived class
ClassA
|
|
ClassB
|
|
ClassC
When one class inherits another class which is further inherited by another class, its known as mutlilevel inheritanc.

Опубликовано:

 

5 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии    
Далее
ЭТО мне КУПИЛИ ПОДПИСЧИКИ 📦
22:33
MILLION JAMOASI 2024 4K
2:17:51
Просмотров 12 млн
Coding Was HARD Until I Learned These 5 Things...
8:34
C# Events and Delegates Made Simple | Mosh
32:04
Просмотров 942 тыс.
If __name__ == "__main__" for Python Developers
8:47
Просмотров 400 тыс.
Premature Optimization
12:39
Просмотров 802 тыс.
ЭТО мне КУПИЛИ ПОДПИСЧИКИ 📦
22:33