class Shape{
public:
virtual void Draw()=0;
};
下列关于 Shape 类的描述中,正确的是
A. )类 Shape 是虚基类
B. )类 Shape 是抽象类
C. )类 Shape 中的 Draw 函数声明有误
D. )语句 “ Shape s; ” 能够建立 Shape 的一个对象 s
[单选题]下面是类Shape的定义: class Shape{ public: virtual void Draw()=0; } 下列关于Shape类的描述中,正确的是( )。A.类Shape是虚基类B.类Shape是抽象类C.类Shape中的Draw函数声明有误D.语句“Shape s;”能够建立Shape的一个对象s
[试题]( 12 ) “ 图形 ” 类 Shape 中定义了纯虚函数 CalArea() ,“ 三角形 ” 类 Triangle 继承了类Shape ,请 将Triangle 类中的 CalArea 函数补充完整。class Shape{public:virtual int CalArea()=0;}class Triangle: public Shape{public:Triangle{int s, int h}: side(s),height(h) {}( 12 ) { return side*hei
[单选题]下面类的定义,有( )处错误。 class MyClass {public: void MyClass(); ~MyClass(int value); private: int i=0;};A.1B.2C.3D.4
[单选题]下面类的定义,有( )处错误。 class MyClass { public: void MyClass(); ~MyClass(int Value); private: int i=0; };A.1B.2C.3D.4
[单选题]下面类的定义,有( )处错误。 class MyClass { public: void MyClass(); ~MyClass(int Value); private: int i=0; };A.1B.2C.3D.4
[主观题]补充完整下面的类定义:class XCH{char*a;public:XCH(char*a A) { //构造函数a=new char[strlen(aA) +1];strcpy(a,aA) ;}XCH&operator=(const XCH&x){//重载赋值函数delete[ ]a;a=new char[strlen(x.A) +1];strcpy(a,x.A) ;______;}~XCH( ){delete[ ]a;}};
[单选题]编译以下代码,将出现什么情况?()abstract class Shape{ abstract void draw();}C.lass Square extends Shape{ }A. Square类和Shape类都可以成功编译B. Square类无法编译,但Shape类可以编译C. 类无法编译,但Square类可以编译D. Square类和Shape类都无法编译
[单选题]The pillar shape that gives the greatest strength for the least weight is the().A . octagonal pillarB . H Beam pillarC . I Beam pillarD . circular type pillar
[单选题]在下面的类定义中,错误的语句是( )。 class Sample { public: Sample(int val): //① ~Sample(); //② private: int a=2.5; //③ Sample(): //④ };A.①②③④B.②C.③D.①②③
[单选题]在下面的类定义中,错误的语句是class Sample { public: Sample(int val); //①~Sample(): //②private: int a=2.5; //③Sample(); //④ };A.①②③④B.②C.③D.①②③