5. Given: class Base { protected: void protectedMethod () { } }; class Derived : public Base { public: void derMeth() { protectedMethod (); } }; // line A int main() { Derived d; // line B d.protectedMethod(); } Which of the following is true?: line A will compile line B will compile d. line A will not compile line B will not compile а. b. line A will compile line B will not compile е. All of the above f. None of the above line A will not compile line B will compile C.
5. Given: class Base { protected: void protectedMethod () { } }; class Derived : public Base { public: void derMeth() { protectedMethod (); } }; // line A int main() { Derived d; // line B d.protectedMethod(); } Which of the following is true?: line A will compile line B will compile d. line A will not compile line B will not compile а. b. line A will compile line B will not compile е. All of the above f. None of the above line A will not compile line B will compile C.
Chapter10: Introduction To Inheritance
Section: Chapter Questions
Problem 12RQ
Related questions
Question
Which of the following is true?
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,