11. String test= “a1b2c3”; 12. String[] tokens = test.split(”//d”); 13. for(String s: tokens) System.out.print(s +“ “); What is the result?()
第1题:
A.abc
B.123
C.a1b2c3
D.a1b2c3
第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?()
第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?()
第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?()
第5题:
11. String test = “This is a test”; 12. String[] tokens = test.split(”/s”); 13. System.out.println(tokens.length); What is the result?()
第6题:
int index = 1; String [] test = new String[3]; String foo = test[index]; What is the result?()
第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”?()
第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"?()
第9题:
String regex = “”;
String regex = “ “;
String regex = “.*“.
String regex = “//s”
String regex = “//.//s*”;
String regex = “//w[ /.] +“;
第10题:
0
1
4
Compilation fails.
第11题:
NULL
Compilation fails.
The code runs with no output.
An exception is thrown at runtime.
第12题:
a b c
1 2 3
a1b2c3
a1 b2 c3
Compilation fails.
The code runs with no output.
An exception is thrown at runtime.
第13题:
int index = 1; String test = new String; String foo = test[index]; What is the result?()
第14题:
public class Test { public static void main(String[] args) { String str = NULL; System.out.println(str); } } What is the result?()
第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?()
第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?()
第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?()
第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?()
第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?()
第20题:
null
finally
null finally
Compilation fails.
finally exception
第21题:
The program runs and prints “Hello”
An error causes compilation to fail.
The program runs and prints “Hello world!”
The program runs but aborts with an exception.
第22题:
0
1
4
Compilation fails.
An exception is thrown at runtime.
第23题:
a b c
1 2 3
a1b2c3
a1 b2 c3