An exception is thrown at runtime.
int Long
Compilation fails.
Short Long
第1题:
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?()
第2题:
collie
harrier
Compilation fails.
collie harrier
An exception is thrown at runtime.
第3题:
test
Exception
Compilation fails.
NullPointerException
第4题:
test
null
An exception is thrown at runtime.
Compilation fails because of an error in line 1.
Compilation fails because of an error in line 4.
Compilation fails because of an error in line 5.
第5题:
TestA
TestB
Compilation fails.
An exception is thrown at runtime.
第6题:
A new Item object is created with the preferred value in the id attribute.
The attribute id in the Item object is modified to the new value.
Compilation fails.
An exception is thrown at runtime.
The attribute id in the Item object remains unchanged.
第7题:
An exception is thrown at runtime.
r, e, o,
Compilation fails.
r, t, t,
第8题:
int Long
Short Long
Compilation fails.
An exception is thrown at runtime.
第9题:
X, followed by an Exception.
No output, and an Exception is thrown.
Compilation fails due to an error on line 14.
Compilation fails due to an error on line 16.
Compilation fails due to an error on line 17.
第10题:
Afoo Afoo
Afoo Bfoo
Bfoo Afoo
Bfoo Bfoo
Compilation fails.
An exception is thrown at runtime.
第11题:
True
Not true
An exception is thrown at runtime.
Compilation fails because of an error at line 12.
Compilation fails because of an error at line 19.
第12题:
Hello
Hello World
Compilation fails.
Hello World 5
The code runs with no output.
An exception is thrown at runtime.
第13题:
Given: 12. System.out.format("Pi is approximately %d.", Math.PI); What is the result?()
第14题:
r, t, t,
r, e, o,
Compilation fails.
An exception is thrown at runtime.
第15题:
Compilation fails.
An exception is thrown at runtime.
The code executes normally and prints "sleep".
The code executes normally, but nothing is printed.
第16题:
B
B, followed by an Exception.
Compilation fails due to an error on line 9.
Compilation fails due to an error on line 14.
An Exception is thrown with no other output.
第17题:
An exception is thrown at runtime.
Pi is approximately 3.
Pi is approximately 3.141593.
Compilation fails.
第18题:
An exception is thrown at runtime.
1
4
Compilation fails.
0
第19题:
peep
bark
meow
Compilation fails.
An exception is thrown at runtime.
第20题:
finished
Exception
Compilation fails.
Arithmetic Exception
第21题:
An Exception is thrown with no other output
followed by an Exception
Compilation fails due to an error on line 9
Compilation fails due to an error on line 14
第22题:
test end
Compilation fails.
test runtime end
test exception end
A Throwable is thrown by main at runtime.
第23题:
short LONG
SHORT LONG
Compilation fails.
An exception is thrown at runtime.