单选题:父类Base和子类Derive的定义如下。请问在子类中,继承的父类成员f,x,y的访问控制权限分别是:
父类Base和子类Derive的定义如下。请问在子类中,继承的父类成员f,x,y的访问控制权限分别是:
class Base
{
public:
void f();
protected:
int x;
private:
int y;
};
class Derive : protected Base
{
};
A.public, protected, private
B.public, public, public
C.private, private, private
D.protected, protected, private
answer:D
class Base
{
public:
void f();
protected:
int x;
private:
int y;
};
class Derive : protected Base
{
};
A.public, protected, private
B.public, public, public
C.private, private, private
D.protected, protected, private
answer:D