0
1
4
Compilation fails.
第1题:
A.abc
B.123
C.a1b2c3
D.a1b2c3
第2题:
11. String test= “a1b2c3”; 12. String[] tokens = test.split(”//d”); 13. for(String s: tokens) System.out.print(s +“ “); What is the result?()
第3题:
Given: 11. String test = "This is a test"; 12. String[] tokens = test.split("/s"); 13. System.out.println(tokens.length); What is the result?()
第4题:
public class test( public int aMethod()[ static int i=0; i++; return I; ) public static void main (String args){ test test = new test(); test.aMethod(); int j = test.aMethod(); System.out.printIn(j); ] } 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题:
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"?()
第7题:
23
234
235
Compilation fails.
第8题:
0
1
2
Compilation fails.
第9题:
0
1
4
Compilation fails.
第10题:
test end
Compilation fails.
test runtime end
test exception end
A Throwable is thrown by main at runtime.
第11题:
String regex = ;
String regex = ;
String regex = .*;
String regex = //s;
String regex = //.//s*;
第12题:
a b c
1 2 3
a1b2c3
a1 b2 c3
第13题:
public class Test { public static void main(String [] args) { boolean assert = true; if(assert) { System.out.println(”assert is true”); } } } Given: javac -source 1.3 Test.java What is the result?()
第14题:
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?()
第15题:
Given: 11.String test = "a1b2c3"; 12.String[] tokens = test.split("//d"); 13.for(String s: tokens) System.out.print(s + " "); What is the result?()
第16题:
public class Test { public int aMethod() { static int i = 0; i++; return i; } public static void main (String args[]) { Test test = new Test(); test.aMethod(); int j = test.aMethod(); System.out.println(j); } } What is the result?()
第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?()
第18题:
String regex = “”;
String regex = “ “;
String regex = “.*“.
String regex = “//s”
String regex = “//.//s*”;
String regex = “//w[ /.] +“;
第19题:
An exception is thrown at runtime.
1
4
Compilation fails.
0
第20题:
x = 0
x = 42
Compilation fails because of an error in line 2 of class Test2.
Compilation fails because of an error in line 3 of class Test1.
Compilation fails because of an error in line 4 of class Test2.
第21题:
Compilation will fail.
Compilation will succeed and the program will print “0”
Compilation will succeed and the program will print “1”
Compilation will succeed and the program will print “2”
第22题:
Compilation fails.
Compilation succeeds with errors.
Compilation succeeds with warnings.
Compilation succeeds without warnings or errors.
第23题:
0
1
4
Compilation fails.
An exception is thrown at runtime.
第24题:
a b c
1 2 3
a1b2c3
a1 b2 c3
Compilation fails.
The code runs with no output.
An exception is thrown at runtime.