String regex = “”;
String regex = “ “;
String regex = “.*“.
String regex = “//s”
String regex = “//.//s*”;
String regex = “//w[ /.] +“;
第1题:
11. String test= “a1b2c3”; 12. String[] tokens = test.split(”//d”); 13. for(String s: tokens) System.out.print(s +“ “); What is the result?()
第2题:
int index = 1; String test = new String; String foo = test[index]; What is the result?()
第3题:
A.Stringregex=“”;
B.Stringregex=““;
C.Stringregex=“.*“.
D.Stringregex=“\\s”
E.Stringregex=“\\.\\s*”;
F.Stringregex=“\\w[\.]+“;
第4题:
11. String test = “This is a test”; 12. String[] tokens = test.split(”/s”); 13. System.out.println(tokens.length); What is the result?()
第5题:
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?()
第6题:
public class Test { public static void main (Stringargs) { String foo = args[1]; String bar = args; String baz = args; System.out.printIn(“baz = ” + baz); } } And the output: Baz = 2 Which command line invocation will produce the output?()
第7题:
Given: 11.String test = "a1b2c3"; 12.String[] tokens = test.split("//d"); 13.for(String s: tokens) System.out.print(s + " "); What is the result?()
第8题:
A.String regex="";
B.String regex=" .";
C.String regex=".*";
D.String regex="\\s";
E.String regex="\\.\\s*";
F.String regex="\\w[\.]+";
第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)
第10题:
int index = 1; String [] test = new String[3]; String foo = test[index]; What is the result?()