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 c3E、 Compilation fails.F、 The code runs with no output.G、 An exception is th

题目

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.
如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

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

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

第4题:

static void test() {  try {  String x=null;  System.out.print(x.toString() +“ “);  }  finally { System.out.print(“finally “); }  }  public static void main(String[] args) {  try { test(); }  catch (Exception ex) { System.out.print(”exception “); }  }  What is the result?() 

  • A、 null
  • B、 finally
  • C、 null finally
  • D、 Compilation fails.
  • E、 finally exception

正确答案:E

第5题:

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

正确答案:A

第6题:

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

第7题:

int index = 1;   String test = new String;   String foo = test[index];  What is the result?()

  • A、  Foo has the value “”
  • B、 Foo has the value null
  • C、 An exception is thrown
  • D、 The code will not compile

正确答案:B

第8题:

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

第9题:

public class Test {  public static void main(String[] args) {  String str = NULL;  System.out.println(str);  }  }   What is the result?()  

  • A、 NULL
  • B、 Compilation fails.
  • C、 The code runs with no output.
  • D、 An exception is thrown at runtime.

正确答案:B

第10题:

12. Date date = new Date();  13. df.setLocale(Locale.ITALY);  14. String s = df.format(date);  The variable df is an object of type DateFormat that has been initialized in line 11. What is the result if this code is run on December 14, 2000?() 

  • A、 The value of s is 14-dic-2004.
  • B、 The value of s is Dec 14, 2000.
  • C、 An exception is thrown at runtime.
  • D、 Compilation fails because of an error in line 13.

正确答案:D

更多相关问题