继承中的隐藏概念

#include <iostream>
#include <stdlib.h>

using namespace std;

class A
{
public:
int age;
void test()
{
cout << "A()" << endl;
}
};

class B : public A
{
public:
int age;
void test()
{
cout << "B()" << endl;
}

};

int main()
{
B b;
b.A::test();


system("pause");
return 0;
}

posted @ 2017-09-11 22:01  w6811645  阅读(127)  评论(0编辑  收藏  举报