class A {
private:
virtualint getI() = 0;
};
class B: public A {
public:
int getI() {return 30;}
};
int main(int argc, char** argv) {
B b;
cout << b.getI();
}
I am expecting that defining B::getI() for public access will cause problem. To my surprise, it compile and run correctly. Is it allowed to redefine the access label for an inherited function? Are there any restrictions?