有如下类定义:class Point{public:Point(int xx=0,int yy=0):x(xx),y(yy) { }private:int x,y;};class Circle:public Point{public:Circle(int r):radius(r) { }private:int radius;};派生类Circle中数据成员的个数是( )。A、3B、1C、5D、2

有如下类定义:

class Point{

public:

Point(int xx=0,int yy=0):x(xx),y(yy) { }

private:

int x,y;

};

class Circle:public Point{

public:

Circle(int r):radius(r) { }

private:

int radius;

};

派生类Circle中数据成员的个数是( )。

A、3

B、1

C、5

D、2


相关考题:

有如下类定义:class Point{int x_, y_;public:Point():x_(0), y_(0){}Point(int x, int y = 0):x_(x),y_(y){}};若执行语句Point a(2), b[3] , *c[4];则 Point 类的构造函数被调用的次数是A . 2 次B . 3 次C . 4 次D . 5 次

( 31 )有如下类定义:class XX{int xx;public:XX ( ) : xx ( 0 ) {cout' A';}XX ( int n ) : xx ( n ) {tout' B';}};Class YY:public XX{Int yy;public:YY ( ) : yy ( 0 ) {cout+yy;}YY ( int n ) : XX ( n+1 ) , yy ( n ) {coutyy;}YY ( int m, int n ) : XX ( m ) , yy ( n ) {coutyy;}};下列选项中,输出结果为 A0 的语句是A ) YY y1(0,0);B ) YY y2(1);C ) YY y3(0);D ) YY y4;

( 13 )有如下类定义:class XX{int xdata;public:XX(int n=0) : xdata (n) { }};class YY : public XX{int ydata;public:YY(int m=0, int n=0) : XX(m), ydata(n) { }};YY 类的对象包含的数据成员的个数是A ) 1B ) 2C ) 3D ) 4

有如下类定义: class Point { int xx.yy; public: Point:xx(0),yy(0){} Point(int x,int Y=0):xx(X),YY(Y){} }; 若执行语句 Point a(2),b[3],幸c[4]; 则Point类的构造函数被调用的次数是( )。A.2次B.3次C.4次D.5次

有如下类定义:class XX{int XX;public:xx():xx(0){toutA;}XX(int n):xx(n){coutB;}};class Y:Y:public XX{int YY;public:YY():YV(O){coutYY;)YY(int n):xx(n+1),YY(n){coutYY;}YY(int m,int n):XX(m),YY(n){coutyy;)};下列选项中,输出结果为A0的语句是A.YY yl(0,0);B.YY 72(1);C.YY y3(0);D.YY y4;

有如下程序: #inCludeiostream using namespaCe std; Class Point{ publiC: statiC int number; publiC: Point( )t.number++;} ~Point( ){number--;} }; , int P0int::number=0; int main( ){ Point *ptr: Point A,B; Point*ptr_point=new Point[3]; ptr=ptr_point;’ } Point C; CoutPoint:::numberendl; delete[]ptr; return 0; } 执行这个程序的输出结果是( )。A.3B.4C.6D.7

有如下类定义:class Point{int x__, y__;public:Point(): x_(0), y_(0) {}Point(int x, int y =0): x_(x), y_(y) {}若执行语句Point a(2),b[3], *c[4];则Point 类的构造函数被调用的次数是( )。A.2次B.3次C.4次D.5次

有如下类定义: class Point { int x_,y_; public: Point():x_(0),y_(0){} Point(int x,int y=0):x_(x),y_(y){} }; 若执行语句 Point a(2),b[3],*c[4]; 则Point类的构造函数被调用的次数是A.2次B.3次C.4次D.5次

有如下类定义: class XX{ int xdata: public: xx(int n=0):xdata(n){} } class YY:public XX{ int ydata; public: YY(int m=0,int n=0):xx(m),ydata(n){ } {; YY类的对象包含的数据成员的个数是A.1B.2C.3D.4