When a class B is inherited publicly from a class A, then the protected members of class A will become _______ in class B.
- public
- private
- protected
- static
When inheritance in C++ is public, the protected members of the base class (Class A in this context) remain protected in the derived class (Class B). This ensures that they are accessible within Class B but not outside of it.
Loading...
Related Quiz
- Which function is used to get the position of the file pointer in a file?
- Consider a large-scale software project that heavily utilizes templates and generic programming. With an impending deadline, the compilation time is becoming a significant bottleneck. Which C++ feature/technique might be best suited to reduce compilation times without altering runtime performance?
- In C++ STL, the function _______ is used to remove consecutive duplicate elements in a range.
- How does C++ handle char literals that are assigned to unsigned char variables?
- You're designing a calendar application and need to determine if a year is a leap year. Leap years are divisible by 4 but not divisible by 100 unless they are also divisible by 400. Which arithmetic operators are crucial for this determination?