下列程序的执行结果是()。# include < iostream >using namespace std;class Test {public:Test(){ n+=2; }~Test() { n-=3;}static int getNum() { return n;}private:static int n;};int Test::n = 1;int main(){Test* P = new Test;delete p;cout<< "n=" < Test::getNum() << endl;return O;}
A. n=0
B. n=1
C. n=2
D. n=3
有以下类定义: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次