itgle.com

Stringtest=a1b2c3”;12.String[]tokens=test.split(”\\d”);13.for(Strings:tokens)System.out.print(s+);Whatistheresult?()A.abcB.123C.a1b2c3D.a1b2c3E.Compilationfails.F.Thecoderunswithnooutput.G.Anexceptionisthrownatruntime.

题目
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

E.Compilationfails.

F.Thecoderunswithnooutput.

G.Anexceptionisthrownatruntime.


相似考题
参考答案和解析
参考答案:A
更多“Stringtest=a1b2c3”;12.String[]tokens=test.split(”\\d”);13.for(Strings:tokens)System.out.print(s+);Whatistheresult?() ”相关问题
  • 第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题:

    写出以下程序的运行结果? public class Test{ public static void main(String argv[]){ String s = new String("hello"); myMethod(s); System.out.print("s=" + s); } public static void myMethod(String s){ s = s + "!"; } }

    A.s=hello!

    B.s=hello

    C.hello!

    D.hello


    2,2,3

  • 第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题:

    1、写出以下程序的运行结果? public class Test{ public static void main(String argv[]){ String s = new String("hello"); myMethod(s); System.out.print("s=" + s); } public static void myMethod(String s){ s = s + "!"; } }

    A.s=hello!

    B.s=hello

    C.hello!

    D.hello


    编译错误