网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

publicclassTest{publicstaticvoidadd3(Integeri){intval=i.intValue();val+=3;i=newInteger(val);}publicstaticvoidmain(Stringargs[]){Integeri=newInteger(0);add3(i);System.out.println(i.intValue());}}Whatistheresult?()

A.0

B.3

C.Compilationfails.

D.Anexceptionisthrownatruntime.


参考答案

更多 “ publicclassTest{publicstaticvoidadd3(Integeri){intval=i.intValue();val+=3;i=newInteger(val);}publicstaticvoidmain(Stringargs[]){Integeri=newInteger(0);add3(i);System.out.println(i.intValue());}}Whatistheresult?()A.0B.3C.Compilationfails.D.Anexceptionisthrownatruntime. ” 相关考题
考题 以下程序段的输出结果是[ ]。 include void ref(int i); void main(){int val=1 以下程序段的输出结果是 [ ] 。include<iostream.h>void ref(int i);void main(){int val=1;cout<<“旧值:”<<val<<end1;ref(val);cout<<”新值:”<<val<<end1;}void ref(int i){i=10;}

考题 Given:Integeri=newInteger(42);Longl=newLong(42);Doubled=newDouble(42.0);Whichtwoexpressionevaluatetotrue?() A.(i==l)B.(i==d)C.(d==l)D.(i.equals(d))E.(i.equals(i))F.(i.equals(42))

考题 public static void main(String[]args){Integer i=new Integer(1)+new Integer(2);switch(i){case3:System.out.println(three);break;default:System.out.println(other);break;}}Whatistheresult?()A.threeB.otherC.Anexceptionisthrownatruntime.D.Compilationfailsbecauseofanerroronline12.E.Compilationfailsbecauseofanerroronline13.F.Compilationfailsbecauseofanerroronline15.

考题 10.publicclassMyClass{11.12.publicIntegerstartingI;13.publicvoidmethodA(){14.Integeri=newInteger(25);15.startingI=i;16.methodB(i);17.}18.privatevoidmethodB(Integeri2){19.i2=i2.intValue();20.21.}22.}IfmethodAisinvoked,whichtwoaretrueatline20?()A.i2==startingIreturnstrue.B.i2==startingIreturnsfalse.C.i2.equals(startingI)returnstrue.D.i2.equals(startingI)returnsfalse.

考题 publicclasstest{publicstaticvoidadd3(Integeri)intval=i.intValue();val+=3;i=newInteger(val);}publicstaticvoidmain(Stringargs[]){Integeri=newInteger(0);add3(i);system.out.printIn(i.intValue());}Whatistheresult?()A.Compilationwillfail.B.Theprogramprints“0”.C.Theprogramprints“3”.D.Compilationwillsucceedbutanexceptionwillbethrownatline3.

考题 Integeri=newInteger(42);Long1=newLong(42);Doubled=newDouble(42.0);WhichtwoexpressionsevaluatetoTrue?() A.(i==1)B.(i==d)C.(d==1)D.(i.equals(d))E.(d.equals(i))F.(i.equals(42)

考题 下列语句中,能完成用整型数10创建一个Integer对象的是( )。A.Integeri=10;B.Integeri=newInteger(10);C.inti=newInteger(10);D.inti=10;

考题 用整数10创建一个Integer类的对象,下列各语句中能完成此功能的是( )。A.Integer i=new Integer(10);B.Integer i=10;C.int i=10;D.Integer i=Integer(10);

考题 Integer i1 = 27; Integer i2 = 27; Integer i3 = 128; Integer i4 = 128; System.out.println(i1==i2); System.out.println(i3==i4); 程序输出的结果是 ()A.true trueB.false falseC.true falseD.false true