Загрузка страницы

Relationship between Virtual Functions, Pure Virtual Functions and Abstract Classes in OOP explained

In this Object-Oriented Programming course, I'm explaining the relationship and purpose of virtual functions, pure virtual functions, and abstract classes.

C++ Virtual functions are functions defined in the base class and redefined in the derived class, whose main purpose is achieving runtime-polymorphism. Virtual functions are defined with the "virtual" keyword in the base class. You can find a detailed explanation and an example in this video, and I'll also show you how the runtime polymorphism achieved by using virtual functions looks like.

Pure virtual functions in C++ (abstract function) in C++ is a virtual function for which we don't write implementation in the base class, but we only declare it. In order to declare a pure virtual function, you need to assign 0 in the declaration

Abstract class in C++ is a class that has at least one pure virtual function. The classes which inherit the abstract class must provide a definition for the pure virtual functions, otherwise, they would be abstract themselves and you wouldn't be able to instantiate them.
The main purpose of an abstract class is to provide an appropriate base class from which other classes can inherit.

🎁 Create Modern Apps, 5x faster, with less code, Download FREE C++Builder Trial: https://bit.ly/CppBuilderFree

Contents:
00:00 - Into
01:31 - Virtual Functions
12:31 - Pure Virtual Functions and Abstract Classes
17:38 - Polymorphism example

🎹 Fun fact, on my language accordion is called "Harmonika" like the word harmony.
Accordion compositions I like: https://bit.ly/compositionsILike
My favorite composition (The Danube Waves): https://bit.ly/TheDanubeWaves

Tag me on you Instagram stories:
Instagram 📸 - https://www.instagram.com/truecodebeauty/
Twitter 🐦- https://twitter.com/TrueCodeBeauty

Видео Relationship between Virtual Functions, Pure Virtual Functions and Abstract Classes in OOP explained канала CodeBeauty
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
15 апреля 2021 г. 21:50:10
00:20:52
Другие видео канала
Abstraction explained with real-life examples and code! - C++ OOP CourseAbstraction explained with real-life examples and code! - C++ OOP CourseHow to Learn Programming and Get A Job in 2021 WITHOUT a CS degree? - CodeBeauty TalksHow to Learn Programming and Get A Job in 2021 WITHOUT a CS degree? - CodeBeauty TalksWhat are header files in C++ ( PROGRAMMING TUTORIAL for beginners)What are header files in C++ ( PROGRAMMING TUTORIAL for beginners)C++ POINTERS (2020) - What is a dynamic two-dimensional array? (MULTIDIMENSIONAL dynamic arrays)C++ POINTERS (2020) - What is a dynamic two-dimensional array? (MULTIDIMENSIONAL dynamic arrays)Abstract Class vs Interface in C# | C# Interview Questions | Csharp Interview QuestionsAbstract Class vs Interface in C# | C# Interview Questions | Csharp Interview QuestionsC++ FUNCTIONS (2020) - What are generic functions and templates? PROGRAMMING TUTORIALC++ FUNCTIONS (2020) - What are generic functions and templates? PROGRAMMING TUTORIALHow to set up VS Code for C++ and make your First Program? + How I use AI to help me code fasterHow to set up VS Code for C++ and make your First Program? + How I use AI to help me code fasterInterfaces in C++ (Pure Virtual Functions)Interfaces in C++ (Pure Virtual Functions)C++ Structures for beginners (explained in 30 minutes) + Test your programming knowledge!C++ Structures for beginners (explained in 30 minutes) + Test your programming knowledge!Exception handling in C++ (How to handle errors in your program?)Exception handling in C++ (How to handle errors in your program?)Developer Q&A - I speak 6 languages? Too late to start programming at 30 years old? + Developer TipsDeveloper Q&A - I speak 6 languages? Too late to start programming at 30 years old? + Developer TipsC++ POINTERS (2020) - How to create/change arrays at runtime? (Dynamic arrays) PROGRAMMING TUTORIALC++ POINTERS (2020) - How to create/change arrays at runtime? (Dynamic arrays) PROGRAMMING TUTORIALC++ file handling for beginners! The easiest way to read/write into text files!C++ file handling for beginners! The easiest way to read/write into text files!Introduction to Linked Lists, Arrays vs Linked Lists, Advantages/Disadvantages - C++ Data StructuresIntroduction to Linked Lists, Arrays vs Linked Lists, Advantages/Disadvantages - C++ Data StructuresAbstract Classes vs Interfaces (Java)Abstract Classes vs Interfaces (Java)C++ POINTERS (2020) - Return multiple values from a function using pointers? PROGRAMMING TUTORIALC++ POINTERS (2020) - Return multiple values from a function using pointers? PROGRAMMING TUTORIALC++ POINTERS (2020) - Introduction to C++ pointers (for beginners) PROGRAMMING TUTORIALC++ POINTERS (2020) - Introduction to C++ pointers (for beginners) PROGRAMMING TUTORIALVirtual Functions & Abstract Classes in C++ | C++ Programming TutorialsVirtual Functions & Abstract Classes in C++ | C++ Programming TutorialsC++ FOR BEGINNERS (2020) - Switch/case statement, How to check days in a month PROGRAMMING TUTORIALC++ FOR BEGINNERS (2020) - Switch/case statement, How to check days in a month PROGRAMMING TUTORIAL
Яндекс.Метрика