Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Post
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
6
Reply
Between public and private inheritance.
siabanie banie
Jan 23 2012 1:11 PM
1.7k
Reply
In c++: What is the difference between public and private inheritance?
As far as I know that public and private inheritance does not dictate what is inherited but how it is inherited? So if I have these choice would it be true if I say the correct answer is: d) but the answer for c) seem true too?
(a) Publicly derived classes inherit only the public data members, whereas privately
derived classes inherit only the private data members
(b) Publicly derived classes inherit both the public and private data members, whereas
privately derived classes inherit only the private data members
(c) Public inheritance makes the public members of the base class public in the derived
class; private inheritance makes public base class members private in the derived
class
(d) Private inheritance changes the default accessibility for new members of a derived
class to private: whereas public inheritance leaves the default for new members as
public:
(e) Public inheritance represents an "is implemented as" relationship, whereas private
inheritance represents an "is a" relationship
Can anyone clarify me on these. Thanks.
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
6
)
Next Recommended Forum
Confused about operator
Pointer