TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
siabanie banie
NA
68
74.1k
Between public and private inheritance.
Jan 23 2012 1:11 PM
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.
Reply
Answers (
6
)
Confused about operator
Pointer