Sunday, April 11, 2010

Difference between public, private, protected inheritance

Public:inherite the protected members as preotected in drived class and pubic members wiull be public in derived
class

Protected:pubic and protecated members of the base class will become protected in derived class

Private:pubilc and proteacted members will become private in derived class

If we have class a and class b:

for Virtuality Mode public
class a class b
private =! private
public = public
protected = public

for Virtuality Mode private

class a claas b
private =! private
public = private
protected = private

for Virtuality Mode protected
class a class b
private =! private
public = protected
protected = protected



0 comments:

Post a Comment