单选题Given: 11.String test = "a1b2c3"; 12.String[] tokens = test.split("//d"); 13.for(String s: tokens) System.out.print(s + " "); What is the result?()A a b cB 1 2 3C a1b2c3D a1 b2 c3

题目
单选题
Given: 11.String test = "a1b2c3"; 12.String[] tokens = test.split("//d"); 13.for(String s: tokens) System.out.print(s + " "); What is the result?()
A

a b c

B

1 2 3

C

a1b2c3

D

a1 b2 c3

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

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

A.0

B.1

C.4

D.Compilationfails.

E.Anexceptionisthrownatruntime.


参考答案:D

第2题:

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

第3题:

public class Test{public static void main(String[]args){intx=5;boolean b1=true;boolean b2=false;if((x==4)&&!b2)System.out.print("l");System.out.print("2");if((b2=true)&&b1)System.out.print("3");}}What is the result?()

A.2

B.3

C.12

D.23

E.123

F.Compilation fails.

G.An exceptional ist hrown at runtime.


参考答案:D

第4题:

public class Base {  public static final String FOO = “foo”;  public static void main(String[] args) {  Base b = new Base();  Sub s = new Sub();  System.out.print(Base.FOO);  System.out.print(Sub.FOO);  System.out.print(b.FOO);  System.out.print(s.FOO);  System.out.print(((Base)s).FOO);  } }  class Sub extends Base {public static final String FOO=bar;}  What is the result?() 

  • A、 foofoofoofoofoo
  • B、 foobarfoobarbar
  • C、 foobarfoofoofoo
  • D、 foobarfoobarfoo
  • E、 barbarbarbarbar
  • F、 foofoofoobarbar
  • G、 foofoofoobarfoo

正确答案:D

第5题:

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*";


参考答案:E

第6题:

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

第7题:

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

第8题:

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

第9题:

public class Test {  public static void main(String [] args) {  int x =5;  boolean b1 = true;  boolean b2 = false;  if((x==4) && !b2)  System.out.print(”l “);  System.out.print(”2 “);  if ((b2 = true) && b1)  System.out.print(”3 “);  } }  What is the result?() 

  • A、 2
  • B、 3
  • C、 1 2
  • D、 2 3
  • E、 1 2 3
  • F、 Compilation fails.
  • G、 Au exceptional is thrown at runtime.

正确答案:D

第10题:

11. String test= “a1b2c3”;  12. String[] tokens = test.split(”//d”);  13. for(String s: tokens) System.out.print(s +“ “);  What is the result?() 

  • A、 a b c
  • B、 1 2 3
  • C、 a1b2c3
  • D、 a1 b2 c3
  • E、 Compilation fails.
  • F、 The code runs with no output.
  • G、 An exception is thrown at runtime.

正确答案:A

更多相关问题