网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
单选题
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


参考答案

参考解析
解析: 暂无解析
更多 “单选题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” 相关考题
考题 Stringtest=Thisisatest”;12.String[]tokens=test.split(”\s”);13.System.out.println(tokens.length);Whatistheresult?() A.0B.1C.4D.Compilationfails.E.Anexceptionisthrownatruntime.

考题 Given:11.Stringtest=Thisisatest;12.String[]tokens=test.split(\s);13.System.out.println(tokens.length);Whatistheresult?() A.Anexceptionisthrownatruntime.B.1C.4D.Compilationfails.E.0

考题 Given:11.Stringtest=Thisisatest;12.String[]tokens=test.split(\s);13.System.out.println(tokens.length);Whatistheresult?() A.0B.1C.4D.Compilationfails.

考题 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 thrown at runtime.

考题 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、 nullB、 zeroC、 someD、 Compilation fails.E、 An exception is thrown at runtime.

考题 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 = "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

考题 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] = 0B、 f[0] = 0.0C、 Compilation fails.D、 An exception is thrown at runtime.

考题 public class Test {  public static void main(String[] args) {  String str = NULL;  System.out.println(str);  }  }   What is the result?()  A、 NULLB、 Compilation fails.C、 The code runs with no output.D、 An exception is thrown at runtime.

考题 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 = nullC、 baz = blueD、 Compilation fails.E、 An exception is thrown at runtime.

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

考题 String a = null;  a.concat(“abc”);  a.concat(“def”);  System.out.println(a);   What is the result?()  A、 abcB、 nullC、 abcdefD、 Compilation fails.E、 The code runs with no output.F、 An exception is thrown at runtime.

考题 11. public static void test(String str) {  12. if(str == null | str.lellgth() == 0) {  13. System.out.println(”String is empty”);  14. } else {  15. System.out.println(”String is not empty”);  16. }  17. }  And the invocation:  31. test(llull);  What is the result?() A、 Au exception is thrown at runtime.B、 “String is empty” is printed to output.C、 Compilation fails because of au error in line 12.D、 “String is not empty” is printed to output.

考题 11. String test = “Test A. Test B. Test C.”;  12. // insert code here  13. String[] result = test.split(regex);  Which regular expression inserted at line 12 will correctly split test into “Test A,” “Test B,” and “Test C”?()A、 String regex = “”;B、 String regex = “ “;C、 String regex = “.*“.D、 String regex = “//s”E、 String regex = “//.//s*”;F、 String regex = “//w[ /.] +“;

考题 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、0B、1C、4D、Compilation fails.

考题 Given: 11.String test = "Test A. Test B. Test C."; 12.// insert code here 13.String[] result = test.split(regex); Which regular expression, inserted at line 12,correctly splits test into "Test A","Test B",and "Test C"?()A、String regex = "";B、String regex = " ";C、String regex = ".*";D、String regex = "//s";E、String regex = "//.//s*";

考题 单选题11. String test = “Test A. Test B. Test C.”;  12. // insert code here  13. String[] result = test.split(regex);  Which regular expression inserted at line 12 will correctly split test into “Test A,” “Test B,” and “Test C”?()A  String regex = “”;B  String regex = “ “;C  String regex = “.*“.D  String regex = “//s”E  String regex = “//.//s*”;F  String regex = “//w[ /.] +“;

考题 单选题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 = nullC  baz = blueD  Compilation fails.E  An exception is thrown at runtime.

考题 单选题11. public static void test(String str) {  12. if(str == null | str.lellgth() == 0) {  13. System.out.println(”String is empty”);  14. } else {  15. System.out.println(”String is not empty”);  16. }  17. }  And the invocation:  31. test(llull);  What is the result?()A  Au exception is thrown at runtime.B  “String is empty” is printed to output.C  Compilation fails because of au error in line 12.D  “String is not empty” is printed to output.

考题 单选题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 0B 1C 4D Compilation fails.

考题 单选题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  nullB  zeroC  someD  Compilation fails.E  An exception is thrown at runtime.

考题 单选题Given: What is the result?()A test endB Compilation fails.C test runtime endD test exception endE A Throwable is thrown by main at runtime.

考题 单选题Given: 11.String test = "Test A. Test B. Test C."; 12.// insert code here 13.String[] result = test.split(regex); Which regular expression, inserted at line 12,correctly splits test into "Test A","Test B",and "Test C"?()A String regex = ;B String regex =  ;C String regex = .*;D String regex = //s;E String regex = //.//s*;

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

考题 单选题public class Test {  public static void main(String[] args) {  String str = NULL;  System.out.println(str);  }  }   What is the result?()A  NULLB  Compilation fails.C  The code runs with no output.D  An exception is thrown at runtime.

考题 单选题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

考题 单选题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 thrown at runtime.