Interview Question: Private Protection

Sample Question #192 (programming – C++)

What are some of the differences between private and protected inheritance in C++?

This entry was posted in Sample Qs. Bookmark the permalink.

One Response to Interview Question: Private Protection

  1. Brett says:

    First, even though it’s probably obvious, you should mention that protected members use the keyword "protected."
    The main difference is when you derive another class ("third-generation" class) from the current derived class, private inheritance prevents the third-gen class from using the internal structure of the base class. With protected inheritance, you don’t have this problem (or feature, depending on how you look at it).

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s