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

题目内容 (请给出正确答案)
单选题
11. String test = “This is a test”;  12. String[] tokens = test.split(”/s”);  13. System.out.println(tokens.length);  What is the result?()
A

 0

B

 1

C

 4

D

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

考题 Given: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*;F.String regex=\\w[\.]+;

考题 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.

考题 说出下面几个函数的区别:private void test(string str){…}private void test(ref string str){…}private void test(out string str){…}如果一个页面与数据

考题 考虑如下类:1. class Test(int i) {2. void test(int i) {3. System.out.println("I am an int.");4. }5. void test(String s) {6. System.out.println("I am a string.");7. }8.9. public static void main(String args[]) {10. Test t=new Test();11. char ch="y";12. t.test(ch);13. }14. }以下哪条为真?A.行 5 不能通过编译,方法不能被覆盖.B.行 12 不能通过编译, 因为没有一个test()方法含字符参数.C.代码可以编译但在12行将出现异常.D.代码可以编译且产生如下输出: I am an int.E.代码可以编译且产生如下输出: I am a String.

考题 执行以下代码会输出什么结果?()   public class Test {    StringgetStr(String s){  return s + “hello”;  }  public static void main(String arg[]) {           Test t= new Test();  System.out.println(t.getStr(“LiLei/n”));     } } A、 编译报错B、 LiLei    helloC、 LiLeihelloD、 无任何输出

考题 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.

考题 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 nullC、 An exception is thrownD、 The code will not compile

考题 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 {  public static void main (String[]args) {  String foo = args[1];  String bar = args[2];  String baz = args[3];  System.out.printIn(“baz = ” + baz);  }  }  And the output:  Baz = 2  Which command line invocation will produce the output?()  A、 Java Test 2222B、 Java Test 1 2 3 4C、 Java Test 4 2 4 2D、 Java Test 4 3 2 1

考题 int index = 1;  String [] test = new String[3];  String foo = test[index];     What is the result?()  A、 Foo has the value “”B、 Foo has the value nullC、 An exception is thrownD、 The code will not compile

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

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

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

考题 单选题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 nullC  An exception is thrownD  The code will not compile

考题 单选题int index = 1;  String [] test = new String[3];  String foo = test[index];     What is the result?()A  Foo has the value “”B  Foo has the value nullC  An exception is thrownD  The code will not compile

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

考题 单选题执行以下代码会输出什么结果?()   public class Test {    StringgetStr(String s){  return s + “hello”;  }  public static void main(String arg[]) {           Test t= new Test();  System.out.println(t.getStr(“LiLei/n”));     } }A  编译报错B  LiLei    helloC  LiLeihelloD  无任何输出

考题 单选题public class Test {  public static void main (String[]args) {  String foo = args[1];  String bar = args[2];  String baz = args[3];  System.out.printIn(“baz = ” + baz);  }  }  And the output:  Baz = 2  Which command line invocation will produce the output?()A  Java Test 2222B  Java Test 1 2 3 4C  Java Test 4 2 4 2D  Java Test 4 3 2 1

考题 单选题Consider the following class:     class Test(int i) {     void test(int i) {  System.out.println(“I am an int.”); }    void test(String s) {   System.out.println(“I am a string.”);     }          public static void main(String args) {    Test t=new Test();     char ch=“y”;    t.test(ch);     }      }     Which of the statements below is true?()A  Line 5 will not compile, because void methods cannot be overridden.B  Line 12 will not compile, because there is no version of test() that rakes a charargument.C  The code will compile but will throw an exception at line 12.D  The code will compile and produce the following output: I am an int.E  The code will compile and produce the following output: I am a String.

考题 单选题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: 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*";F String regex="//w[/.]+";