单选题Given:   11. String test = "This is a test";   12. String[] tokens = test.split("/s");   13. System.out.println(tokens.length);   What is the result?()A  An exception is thrown at runtime.B  1C  4D  Compilation fails.E  0

题目
单选题
Given:   11. String test = "This is a test";   12. String[] tokens = test.split("/s");   13. System.out.println(tokens.length);   What is the result?()
A

 An exception is thrown at runtime.

B

 1

C

 4

D

 Compilation fails.

E

 0

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

第1题:

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

第2题:

public static void main(String[] args) {  String str = “null‟;  if (str == null) {  System.out.println(”null”);  } else (str.length() == 0) {  System.out.println(”zero”);  } else {  System.out.println(”some”);  }  }  What is the result?()

  • A、 null
  • B、 zero
  • C、 some
  • D、 Compilation fails.
  • E、 An exception is thrown at runtime.

正确答案:D

第3题:

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

第4题:

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

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

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

第7题:

Given:   11. String test = "This is a test";   12. String[] tokens = test.split("/s");   13. System.out.println(tokens.length);   What is the result?()

  • A、 An exception is thrown at runtime.
  • B、 1
  • C、 4
  • D、 Compilation fails.
  • E、 0

正确答案:D

第8题:

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

第9题:

public class Test {  private static float[] f = new float[2];  public static void main(String args[]) {  System.out.println(“f[0] = “ + f[0]);  }  }   What is the result?()  

  • A、 f[0] = 0
  • B、 f[0] = 0.0
  • C、 Compilation fails.
  • D、 An exception is thrown at runtime.

正确答案:B

第10题:

public class Test {  public static void main( String[] args) {  String foo = args[1];  String bar = args[2];  String baz = args[3];  System.out.println(“baz = “ + baz); }  }   And the command line invocation: java Test red green blue   What is the result?()  

  • A、 baz =
  • B、 baz = null
  • C、 baz = blue
  • D、 Compilation fails.
  • E、 An exception is thrown at runtime.

正确答案:E

更多相关问题