#include <iostream>
usingnamespace std;
class Parent{
protected:
void Test1(){
cout<<"I am protected in base class";
}
void Test2(){
cout<<"I am Protected too in base class";
}
};
class Child:public Parent{
public:
using Parent::Test1; // What will happen here
};
void main()
{
Child obj;
obj.Test1(); // Why it has accesssible, it is protected in base class
//obj.Test2(); //Compilation Error
}
Why the above code is working for Test1() function.