class Father {
public:
Father() {
}
static void func() {
cout << "father::func()" << endl;
}
static void func(int p) {
cout << "father::func(int p)" << endl;
}
static int a;
};
int Father::a = 100;
class Son :public Father{
public:
Son() {
}
static void func() {
cout << "son::func()" << endl;
}
static int a;
};
int Son::a = 200;
void test() {
Son son;
cout << son.a << endl;
cout << son.Father::a << endl;
son.func();
son.Father::func();
son.Father::func(100);
cout << Son::a << endl;
cout << Son::Father::a << endl;
cout << Father::a << endl;
Son::func();
Son::Father::func();
Father::func();
}
int main() {
test();
}