1.

Which specifier allows to secure the public members of base class in inherited classes?(a) Private(b) Protected(c) Public(d) Private and ProtectedI got this question by my school teacher while I was bunking the class.My question comes from Public Access Specifier topic in division Access Specifiers of Object Oriented Programming

Answer»

The CORRECT choice is (d) Private and Protected

The EXPLANATION: Both the private and protected specifiers can make the public members of the base CLASS more secure. This is USEFUL if we stop using the parent class members and use the CLASSES which inherited the parent class, so as to secure data better.



Discussion

No Comment Found

Related InterviewSolutions