c++ - What is the value of private members here? -
if have 2 classes a
, b
, such b
inehrits a
. in other words, a
base class, , b
derived class.
now, suppose class a
has private
members. since class b
inherited class a
, private data members became part of class b
.
as know, private members said not accessed derived classes, but, in derived class. value of privacy in case?
thanks.
they aren't usable in way member functions of b
, useful member functions of a
, b
in turn rely on. it's level of encapsulation (b
shouldn't care how functionality of a
implemented).
Comments
Post a Comment