合同成立的根本标志在于()。
A.当事人就合同主要条款达成合意
B.经历了要约与承诺阶段
C.履行了一定的缔约方式
D.交付标的物
第1题
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?()
第2题
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”)
第3题
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?()
第4题
A.Thecodewillnotcompile.
B.Theoutputiscaughtexception.
C.TheoutputiscaughtIOException.
D.Theprogramexecutesnormallywithoutprintingamessage.
第5题
A.Theprogramrunsandprintsnothing.
B.Theprogramrunsandprints“Finally”
C.Thecodecompiles,butanexceptionisthrownatruntime.
D.Thecodewillnotcompilebecausethecatchblockismissing.
第6题
A.Char
B.Byte
C.Float
D.Double
E.Object
第7题
A.0
B.3
C.4
D.5
E.Thecodewillnotcompile.
第8题
A.Theoutputis“Equal”
B.Theoutputin“NotEqual”
C.Anerroratline5causescompilationtofall.
D.Theprogramexecutesbutdoesnotprintamessage.
第9题
A.Justafterline5
B.Justafterline6
C.Justafterline7(thatis,asthemethodreturns)
D.Neverinthismethod.
第10题
A.OutputStreamout=newFileOutputStream(“file.txt”); Out.writeBytes(“/n”);
B.OutputStreamos=newFileOutputStream(“file.txt”,true); DataOutputStreamout=newDataOutputStream(os);out.writeBytes(“/n”);
C.OutputStreamos=newFileOutputStream(“file.txt”); DataOutputStreamout=newDataOutputStream(os);out.writeBytes(“/n”);
D.OutputStreamos=newOutputStream(“file.txt”,true); DataOutputStreamout=newDataOutputStream(os);out.writeBytes(“/n”);
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!