I have a question regarding Inheritance, Is it possible to have a derived class of a private base class?
Thanks in advance
Yes, I was reading about getters and setters and the point that I got is that one can access private members of a class from outside of a class by using getters and setters,
am I right?
Only Ant can use Bat, Bat doesn't exist outside of Ant because it's private. Ant can use Bat objects and access data members the same way you can access data members from an Ant object in a function.
You may also use the access modifier
protected: to hide members outside of the class hierarchy.