niusouti.com
参考答案和解析
参考答案:B
更多“intindex=1;Stringtest=newString;Stringfoo=test[index];Whatistheresult?() ”相关问题
  • 第1题:

    intindex=1;boolean[]test=newBoolean[3];booleanfoo=test[index];Whatistheresult?()

    A.Foohasthevalueof0.

    B.Foohasthevalueofnull.

    C.Foohasthevalueoftrue.

    D.Foohasthevalueoffalse.

    E.Anexceptionisthrown.

    F.Thecodewillnotcompile.


    参考答案:D

  • 第2题:

    Given:11.Stringtest="Thisisatest";12.String[]tokens=test.split("\s");13.System.out.println(tokens.length);Whatistheresult?()

    A.Anexceptionisthrownatruntime.

    B.1

    C.4

    D.Compilationfails.

    E.0


    参考答案:D

  • 第3题:

    Given:11.Stringtest="a1b2c3";12.String[]tokens=test.split("\\d");13.for(Strings:tokens)System.out.print(s+"");Whatistheresult?()

    A.abc

    B.123

    C.a1b2c3

    D.a1b2c3


    参考答案:A

  • 第4题:

    intindex=1;intfoo=newint;intbar=foo[index];intbaz=bar+index;Whatistheresult?()

    A.Bazhasthevalueof0

    B.Bazhasthevalueof1

    C.Bazhasthevalueof2

    D.Anexceptionisthrown.

    E.Thecodewillnotcompile.


    参考答案:B

  • 第5题:

    Given:11.Stringtest="Thisisatest";12.String[]tokens=test.split("\s");13.System.out.println(tokens.length);Whatistheresult?()

    A.0

    B.1

    C.4

    D.Compilationfails.


    参考答案:D