A.营业税1 145元
B.营业税1 575元
C.城市维护建设税和教育费附加114.5元
D.城市维护建设税和教育费附加157.5元
第1题
A. Run();
B. Start();
C. Execute();
D. Run(Runnable r);
E. Start(Runnable r);
F. Execute(Thread t);
第2题
publicstaticvoidmain(Stringargs){
finalStringBuffers1=newStringBuffer();
finalStringBuffers2=newStringBuffer();
newThread(){
publicvoidrun(){
synchronized(s1){
s2.append(A”);
synchronized(s2){
s2.append(B”);
System.out.print(s1);
System.out.print(s2);
}
}
}
}.start();
newThread(){
publicvoidrun(){
synchronized(s2){
s2.append(C”);
synchronized(s1){
s1.append(D”);
System.out.print(s2);
System.out.print(s1);
}
}
}
}.start();
}
}
Whichtwostatementsaretrue?()
第3题
A.Anerroratline11causescompilationtofail.
B.Errorsatlines7and8causecompilationtofail.
C.Theprogramprintspairsofvaluesforxandythatmightnotalwaysbethesameonthesameline(forexample,“x=2,y=1”)
D.Theprogramprintspairsofvaluesforxandythatarealwaysthesameonthesameline(forexample,“x=1,y=1”.Inaddition,eachvalueappearstwice(forexample,“x=1,y=1”followedby“x=1,y=1”)
E.Theprogramprintspairsofvaluesforxandythatarealwaysthesameonthesameline(forexample,“x=1,y=1”.Inaddition,eachvalueappearstwice(forexample,“x=1,y=1”followedby“x=2s,y=2”)
第4题
2.inti;
3.publicvoidrun()(
4.try(
5.thread.sleep(5000);
6.i=10;
7.)catch(InterruptedExceptione){}
8.)
9.)
10.
11.publicclassTest{
12.publicstaticvoidmain(stringargs)(
13.try(
14.Aa=newA();
15.Threadt=newThread(a);
16.t.start();
17.
18.intj=a.i;
19.
20.)catch(Exceptione){}
21.)
22.)
Whichstatementalline17willensurethatj=10atline19?()
第5题
A.Thecodewillnotcompile.
B.Theoutputiscaughtexception.
C.TheoutputiscaughtIOException.
D.Theprogramexecutesnormallywithoutprintingamessage.
第6题
A.Theprogramrunsandprintsnothing.
B.Theprogramrunsandprints“Finally”
C.Thecodecompiles,butanexceptionisthrownatruntime.
D.Thecodewillnotcompilebecausethecatchblockismissing.
第7题
A.Char
B.Byte
C.Float
D.Double
E.Object
第8题
A.0
B.3
C.4
D.5
E.Thecodewillnotcompile.
第9题
A.Theoutputis“Equal”
B.Theoutputin“NotEqual”
C.Anerroratline5causescompilationtofall.
D.Theprogramexecutesbutdoesnotprintamessage.
第10题
A.Justafterline5
B.Justafterline6
C.Justafterline7(thatis,asthemethodreturns)
D.Neverinthismethod.
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!