问题
单项选择题
可以用p.a的形式访问派生类对象p的基类成员a,其中a是( )。
A.私有继承的公有成员
B.公有继承的私有成员
C.公有继承的保护成员
D.公有继承的公有成员
答案
参考答案:D
解析:只有公有继承的公有成员才能被派生类的对象直接访问,其他的 情况都会因为访问权限问题产生错误。
可以用p.a的形式访问派生类对象p的基类成员a,其中a是( )。
A.私有继承的公有成员
B.公有继承的私有成员
C.公有继承的保护成员
D.公有继承的公有成员
参考答案:D
解析:只有公有继承的公有成员才能被派生类的对象直接访问,其他的 情况都会因为访问权限问题产生错误。
完形填空。 | ||||
There are different 1 of animals in the zoo. They don't have to 2 food by themselves. We can see the zoo keepers give them food to 3 . They just eat, walk and sleep 4 day. So many of us may think that the animals there are 5 and lucky. But most of them are sad. Why? They're no 6 free! Animals like elephants, monkeys and tigers usually live freely and happily in forests or mountains. Tigers, for 7 , run, jump, play with their children and catch small animals for food. But now they have to stay in small room in the zoo. Their life in the zoo is quite 8 from their life in the forests. Now many of us think more animals should go 9 to forests and mountains so 10 the earth will become better. | ||||
|