class Base {
public:
void method1();
protected:
void method2();
private:
void method3();
};
class Child : public Base {
protected:
void method1() { }
void method2() { }
void method3() { }
};
int main() {
Base* base = new Child();
base->method1(); // 1
base->method2(); // 2
base->method3(); // 3
return 0;
}
Login in to like
Login in to comment