Given:11.Stringtest="TestA.TestB.TestC.";12.//insertcodehere13.String[]result=test.split(regex);Whichregularexpression,insertedatline12,correctlysplitstestinto"TestA","TestB",and"TestC"?()A.Stringregex="";B.Stringregex="";C.Stringregex=".*";D.Stringregex=

题目

Given:11.Stringtest="TestA.TestB.TestC.";12.//insertcodehere13.String[]result=test.split(regex);Whichregularexpression,insertedatline12,correctlysplitstestinto"TestA","TestB",and"TestC"?()

A.Stringregex="";

B.Stringregex="";

C.Stringregex=".*";

D.Stringregex="\\s";

E.Stringregex="\\.\\s*";


相似考题
更多“Given:11.Stringtest="TestA.TestB.TestC.";12.//insertcodehere13.String[]result=te ”相关问题
  • 第1题:

    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

  • 第2题:

    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

  • 第3题:

    下面的方法,当参数值为2的时候返回值是多少 1. public int getValue(int i) { 2. int result = 0; 3. switch (i) { 4. case 1: 5. result = result + i; 6. case 2: 7. result = result + i * 2; 8. case 3: 9. result = result + i * 3; 10. } 11. return result; 12. }

    A.10

    B.8

    C.6

    D.4

    E.2

    F.0


    错误

  • 第4题:

    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

  • 第5题:

    Given11.publicinterfaceStatus{12./*insertcodehere*/intMY_VALUE=10;13.}Whichthreearevalidonline12?()

    A.final

    B.static

    C.native

    D.public

    E.private


    参考答案:A, B, D