How to restrict an access to some of the functions at third level in Classes (OOPs)
- by Shantanu Gupta
I have created a class say A which has some functions defined as protected.
Now Class B inherits A and class C inherits B. Class A has private default constructor and protected parameterized constructor.
I want Class B to be able to access all the protected functions defined in Class A but class C can have access on some of the functions only not all the functions and class C is inheriting class B.
How can I restrict access to some of the functions of Class A from Class C ?
Class A
{
private A(){}
protected A(int ){}
}
Class B : A
{}
CLass C:B
{
}