An exception is thrown at runtime.
1
4
Compilation fails.
0
第1题:
A.0
B.1
C.4
D.Compilationfails.
第2题:
public static void main(String[] args) { String str = “null‟; if (str == null) { System.out.println(”null”); } else (str.length() == 0) { System.out.println(”zero”); } else { System.out.println(”some”); } } What is the result?()
第3题:
A.0
B.1
C.4
D.Compilationfails.
E.Anexceptionisthrownatruntime.
第4题:
public class Test { public static void main(String[] args) { String str = NULL; System.out.println(str); } } What is the result?()
第5题:
Given: 11.String test = "a1b2c3"; 12.String[] tokens = test.split("//d"); 13.for(String s: tokens) System.out.print(s + " "); What is the result?()
第6题:
11. String test= “a1b2c3”; 12. String[] tokens = test.split(”//d”); 13. for(String s: tokens) System.out.print(s +“ “); What is the result?()
第7题:
Given: 11. String test = "This is a test"; 12. String[] tokens = test.split("/s"); 13. System.out.println(tokens.length); What is the result?()
第8题:
A.Anexceptionisthrownatruntime.
B.1
C.4
D.Compilationfails.
E.0
第9题:
public class Test { private static float[] f = new float[2]; public static void main(String args[]) { System.out.println(“f[0] = “ + f[0]); } } What is the result?()
第10题:
public class Test { public static void main( String[] args) { String foo = args[1]; String bar = args[2]; String baz = args[3]; System.out.println(“baz = “ + baz); } } And the command line invocation: java Test red green blue What is the result?()