1
2
12
Compilation fails.
No output is produced.
An exception is thrown at runtime.
第1题:
A.00
B.0001
C.000120
D.00012021
E.Compilation fails.
F.An exception is thrown at runtime.
第2题:
public class Alpha{ public static void main( string[] args ){ if ( args.length == 2 ) { if ( args.[0].equalsIgnoreCase(“-b”) ) System.out.println( new Boolean( args[1] )); } } } And the code is invoked by using the command: java Alpha –b TRUE What is the result?()
第3题:
A.Value is: 8
B.Compilation fails.
C.Value is: 12
D.Value is: -12
E.The code runs with no output.
F.An exception is thrown at runtime.
第4题:
collie
harrier
Compilation fails.
collie harrier
An exception is thrown at runtime.
第5题:
System.out.println(Math.sqrt(-4D)); What is the result?()
第6题:
A.42
B.420
C.462
D.42042
E.Compilation fails.
F.An exception is thrown at runtime.
第7题:
public class Foo { public static void main(String[] args) { try { return; } finally { System.out.println( “Finally” ); } } } What is the result?()
第8题:
A.Compilation fails.
B.ClassC is displayed.
C.The code runs with no output.
D.An exception is thrown at runtime.
第9题:
String a = null; a.concat(“abc”); a.concat(“def”); System.out.println(a); What is the result?()
第10题:
r, t, t,
r, e, o,
Compilation fails.
An exception is thrown at runtime.