A.Afterline16.
B.Afterline17.
C.Afterline18(whenthemethodsends).
D.Thereisnowaytobeabsolutelycertain.
E.TheobjectisNOTeligibleforgarbagecollection.
第1题:
A.Justafterline5
B.Justafterline6
C.Justafterline7(thatis,asthemethodreturns)
D.Neverinthismethod.
第2题:
2、假设 A 是一个类的名字,下面的语句生成了()个类A的对象。 A * arr[4] = { new A(), NULL,new A() };
A.3
B.4
C.1
D.2
第3题:
假设 A 是一个类的名字,下面的语句生成了几个类A的对象? A * arr[4] = { new A(), NULL,new A() };
A.A) 1
B.B) 2
C.C) 3
D.D) 4
第4题:
class A{
void P1(){cout<<"A111"};
void P2(){cout<<"A222"};
};
class B:public A{
void P1(){cout<<"B111"};
virtual void P2(){cout<<"B222"};
}
..........
A*cl=NULL;
cl=new A;
A->P1();
A->P2();
delete cl;
cl=NULL;
cl=new B;
A->P1();
A->P2();
delete cl;
cl=NULL;
..........
写出运行结果;
第5题:
2、假设 A 是一个类的名字,下面的语句生成了几个类A的对象? A * arr[4] = { new A(), NULL,new A() };
A.A) 1
B.B) 2
C.C) 3
D.D) 4