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 t

题目

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
更多“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”相关问题
  • 第1题:

    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

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

    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

  • 第4题:

    public class X {  public static void main (String[]args)  {  String s1 = new String (“true”);  Boolean b1 = new Boolean (true);  if (s2.equals(b1))   {  System.out.printIn(“Equal”);  }  }  }      What is the result?()  

    • A、 The program runs and prints nothing.
    • B、 The program runs and prints “Equal”
    • C、 An error at line 5 causes compilation to fail.
    • D、 The program runs but aborts with an exception.

    正确答案:A

  • 第5题:

    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

  • 第6题:

    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

  • 第7题:

    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

  • 第8题:

    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

  • 第9题:

    单选题
    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
    解析: 暂无解析

  • 第10题:

    单选题
    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
    解析: 暂无解析

  • 第11题:

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


    正确答案: C
    解析: NULL should be "null".

  • 第12题:

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


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

  • 第13题:

    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

  • 第14题:

    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

  • 第15题:

    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

  • 第16题:

     public class X {   public static void main (String[]args)   {   string s = new string (“Hello”);   modify(s);   System.out.printIn(s);   }   public static void modify (String s)  {   s += “world!”;      }   }      What is the result?()    

    • A、 The program runs and prints “Hello”
    • B、 An error causes compilation to fail.
    • C、 The program runs and prints “Hello world!”
    • D、 The program runs but aborts with an exception.

    正确答案:A

  • 第17题:

    public class X {   public static void main (Stringargs) {   string s = new string (“Hello”);   modify(s);   System.out.printIn(s);   }   public static void modify (String s) {   s += “world!”;   }   }   What is the result?() 

    • A、The program runs and prints “Hello”
    • B、An error causes compilation to fail.
    • C、The program runs and prints “Hello world!”
    • D、The program runs but aborts with an exception.

    正确答案:A

  • 第18题:

    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.

    正确答案:A

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

    正确答案:D

  • 第20题:

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


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

  • 第21题:

    单选题
    public class X {   public static void main (String[]args)   {   string s = new string (“Hello”);   modify(s);   System.out.printIn(s);   }   public static void modify (String s)  {   s += “world!”;      }   }      What is the result?()
    A

     The program runs and prints “Hello”

    B

     An error causes compilation to fail.

    C

     The program runs and prints “Hello world!”

    D

     The program runs but aborts with an exception.


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

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

    单选题
    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
    解析: 暂无解析