C++ Multiple Constructors and Polymorphism

Subscribers:
58,800
Published on ● Video Link: https://www.youtube.com/watch?v=Ny9l1U-zYgc



Duration: 0:00
90 views
6


C++ Object Oriented Programming. C++ Classes and OOP. In the previous video we went over how to define a struct, add class data members, and methods to represent a Fraction. We've gone over setters and getters to update the data members. In the previous video, we cover the constructor, which can be used to initialize the data members at the time of object creation. In this video, we will expand the topic and introduce multiple constructors, which is a form of polymorphism. With multiple constructors, we can have users pass in different value types and different number of parameters into the constructor. This can be achieved with declaring multiple constructors, or adding default parameters

public - members are accessible outside the class
private - members cannot be accessed outside the class
protected - members cannot be accessed outside the class, but can be accessed by inheritance

C++ OOP Playlist:
   • C++ Object Oriented Programming  

Beginner C++ Playlist:
   • C++ Programming Tutorial  

Github Repo for C++ OOP Code:
https://github.com/ImKennyYip/cpp-oop

Install C++ with VS Code:
   • How to set up C++ in Visual Studio Code  

Subscribe for more coding tutorials 😄 !

🌟 If you enjoyed the tutorial and would like to support the channel, you can do so here: https://buymeacoffee.com/kennyyipcoding