An exception is thrown at runtime.
int Long
Compilation fails.
Short Long
第1题:
try { int x = 0; int y = 5 / x; } catch (Exception e) { System.out.println(“Exception”); } catch (ArithmeticException ae) { System.out.println(“Arithmetic Exception”); } System.out.println(“finished”); What is the result?()
第2题:
public class Wow { public static void go(short n) {System.out.println(”short”); } public static void go(Short n) {System.out.println(”SHORT”);} public static void go(Long n) {System.out.println(” LONG”); } public static void main(String [] args) { Short y= 6; int z=7; go(y); go(z); } } What is the result?()
第3题:
A.00
B.0001
C.000120
D.00012021
E.Compilation fails.
F.An exception is thrown at runtime.
第4题:
test
Exception
Compilation fails.
NullPointerException
第5题:
collie
harrier
Compilation fails.
collie harrier
An exception is thrown at runtime.
第6题:
public class Yikes { public static void go(Long n) {System.out.println(”Long “);} public static void go(Short n) {System.out.println(”Short “);} public static void go(int n) {System.out.println(”int “);} public static void main(String [] args) { short y= 6; long z= 7; go(y); go(z); } } What is the result?()
第7题:
Given: 12. System.out.format("Pi is approximately %d.", Math.PI); What is the result?()
第8题:
Given: 11. String test = "This is a test"; 12. String[] tokens = test.split("/s"); 13. System.out.println(tokens.length); What is the result?()
第9题:
r, t, t,
r, e, o,
Compilation fails.
An exception is thrown at runtime.
第10题:
Compilation fails.
An exception is thrown at runtime.
The code executes normally and prints "sleep".
The code executes normally, but nothing is printed.