To force derived classes to use the public interface of the base class. This makes the class more resilient so it can't go around any type of validation code that might be in methods that make up the public interface of the base class. The downside is it is slower to access those inherited variables, but that's the trade off you make. Safety vs speed.
@@ProfessorHankStalica so now it is clear i thought when i make a private access specifier with inherited constructor that i can not access it publicly but now i understand that i could (so i ll call the constructor in the public interface of the base class so this will ensure that i dont make any unnecessary changes by fault when calling the constructor as it will have the specefiers and properties within the base constructor) and thanks for your time .
Your video was absolutely helpful !!!
one question why we use a private access specifier when inheriting the base constructor 7:58 ??
To force derived classes to use the public interface of the base class. This makes the class more resilient so it can't go around any type of validation code that might be in methods that make up the public interface of the base class.
The downside is it is slower to access those inherited variables, but that's the trade off you make. Safety vs speed.
@@ProfessorHankStalica so now it is clear i thought when i make a private access specifier with inherited constructor that i can not access it publicly but now i understand that i could (so i ll call the constructor in the public interface of the base class so this will ensure that i dont make any unnecessary changes by fault when calling the constructor as it will have the specefiers and properties within the base constructor) and thanks for your time .
You are helpful god bless you
Happy to help
most underratted proff. Love ur vids
Great video, thanks!
Glad you liked it!
Thank you
Hi, could I inherit a constructor using this ? class Derived : public Base :: Base()
❤
thank you 😊
You're welcome 😊
Thank you.
You're welcome!