题目
A.A. To inform
B.B. To request
C.C. To record
第1题
A.123
B.Compilation fails because of an error in line 12.
C.Compilation fails because of an error in line 13.
D.Compilation fails because of an error in line 14.
E.A ClassCastException is thrown at runtime.
第2题
第3题
A.232
B.231
C.222
D.221
第4题
下列程序的执行结果是 () public class ex68{ public static void main(String[]args){ ex68 obj=new ex68(); int s=0; for(int i=1;i<=4;i++){ s+=obj.method(i); } System.out.println(s); } public int method(int n){ if(n==1) return 1; else return n*method(n-1); } }
A.3
B.9
C.33
D.153
第5题
A.232
B.231
C.222
D.221
第6题
(29 ) 有如下程序 :
#include
using namespace std;
class Obj{
static int i;
public:
Obj(){ i++; }
~Obj(){ i--; }
static int getVal(){ return i;}
};
int Obj::i=0;
void f(){Obj ob2; cout<
int main(){
Obj ob1;
f();
Obj *ob3=new Obj; cout<getVal();
delete ob3; cout< return 0;
}
程序的输出结果是
A ) 232
B ) 231
C ) 222
D ) 221
第7题
第8题
第9题
有如下程序:#include <iostream>using namespace std;class Obj { static int i;public: Obj(){i++;} -Obj(){i--;} static int getVal(){return i;} };int Obj::i=0;void f(){Obj ob2; cout<<ob2.getVal(); }hat main(){ Obj ob1; f(); Obj *ob3=new Obj; cout<<ob3->getVal(); delete ob3; cout<<Obj:: getVal(); return (); }程序的输出结果是()。
A.232
B.231
C.222
D.221
第10题
A.0
B.1
C.2
D.3
第11题
A.0
B.1
C.2
D.3
为了保护您的账号安全,请在“赏学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!