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

题目
单选题
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”相关问题
  • 第1题:

    package test1;  public class Test1 {  static int x = 42;  }  package test2;  public class Test2 extends test1.Test1 {  public static void main(String[] args) { System.out.println(“x = “ + x);  }  }  What is the result?() 

    • A、 x = 0
    • B、 x = 42
    • C、 Compilation fails because of an error in line 2 of class Test2.
    • D、 Compilation fails because of an error in line 3 of class Test1.
    • E、 Compilation fails because of an error in line 4 of class Test2.

    正确答案:C

  • 第2题:

    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

  • 第3题:

    public class Test{  public static void main( String[] argv ){  // insert statement here  }  }   Which statement, inserted at line 3, produces the following output?()  Exception in thread “main” java.lang.AssertionError: true at Test.main(Test.java:3)  

    • A、 assert true;
    • B、 assert false;
    • C、 assert false : true;
    • D、 assert false == true;
    • E、 assert false: false;

    正确答案:C

  • 第4题:

    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 null
    • C、 An exception is thrown
    • D、 The code will not compile

    正确答案:B

  • 第5题:

    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[ /.] +“;

    正确答案:E

  • 第6题:

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

    正确答案:E

  • 第7题:

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

    C

     An exception is thrown

    D

     The code will not compile


    正确答案: B
    解析: 暂无解析

  • 第8题:

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

    B

     Java Test 1 2 3 4

    C

     Java Test 4 2 4 2

    D

     Java Test 4 3 2 1


    正确答案: B
    解析: 暂无解析

  • 第9题:

    单选题
    public class Test{  public static void main( String[] argv ){  // insert statement here  }  }   Which statement, inserted at line 3, produces the following output?()  Exception in thread “main” java.lang.AssertionError: true at Test.main(Test.java:3)
    A

     assert true;

    B

     assert false;

    C

     assert false : true;

    D

     assert false == true;

    E

     assert false: false;


    正确答案: C
    解析: 暂无解析

  • 第10题:

    单选题
    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*;


    正确答案: E
    解析: 暂无解析

  • 第11题:

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


    正确答案: B
    解析: 暂无解析

  • 第12题:

    单选题
    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[/.]+";


    正确答案: E
    解析: 暂无解析

  • 第13题:

    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

  • 第14题:

    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 2222
    • B、 Java Test 1 2 3 4
    • C、 Java Test 4 2 4 2
    • D、 Java Test 4 3 2 1

    正确答案:C

  • 第15题:

    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.

    正确答案:D

  • 第16题:

    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.

    正确答案:D

  • 第17题:

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

    正确答案:D

  • 第18题:

    单选题
    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[ /.] +“;


    正确答案: E
    解析: 暂无解析

  • 第19题:

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


    正确答案: C
    解析: 暂无解析

  • 第20题:

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

    0

    B

    1

    C

    4

    D

    Compilation fails.


    正确答案: A
    解析: 暂无解析

  • 第21题:

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


    正确答案: A
    解析: 暂无解析

  • 第22题:

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


    正确答案: C
    解析: 暂无解析

  • 第23题:

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


    正确答案: D
    解析: 在第12行,16位长的char型变量ch在编译时会自动转化为一个32位长的int型,并在运行时传给void test(int i)方法。