单项选择题
有如下程序: #include
#include
using namespace std; class Animal{ public: virtual string GetType() const { return "Animal"; } virtual string GetVoice() const { return "Voice"; } }; class Dog:public Animal{ public: string GetType() const { return "Dog"; } string GetVoice() const { return "Woof"; } }; class Cat:public Animal{ public: string GetType() const { return "Cat"; } string GetVoice() const { return "Miaow"; } }; void Type(Animal& a) { cout<
A.DogspeakVoice-CatspeakVoice
B.DogspeakWoof-CatspeakMiaow
C.AnimalspeakVoice-AnimalspeakVoice
D.AnimalspeakWoof-AnimalspeakMiaow
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
执行语句序列 int n=0; for (int i=60; i>0; i-=3) n++;之后,变量n的值是
A.20
B.21
C.60
D.61
点击查看答案&解析
单项选择题
将运算符*重载为类成员函数时,其参数表中有且仅有一个参数,说明该运算符是
A.无操作数的运算符
B.无操作数的运算符
C.二元运算符
D.三元运算符
点击查看答案&解析
相关试题
下列关于函数模板的表述中,正确的是
有如下类声明: class Te{ public: T...
下面对对象概念描述正确的是
有如下类定义: class AA{ int a; p...
在黑盒测试方法中,设计测试用例的主要根据...