How does C++ enforce encapsulation and abstraction in multi-level inheritance scenarios? 

  • By using abstract classes only. 
  • By private and protected access specifiers. 
  • Through use of virtual functions alone. 
  • By using friend functions.
In C++, encapsulation and abstraction in multi-level inheritance are primarily enforced using private and protected access specifiers. While private members are inaccessible outside the class, protected members can be accessed by derived classes, ensuring a controlled inheritance mechanism.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *