An exception is thrown at runtime.
r, e, o,
Compilation fails.
r, t, t,
第1题:
public static void test(String str) { int check = 4; if (check = str.length()) { System.out.print(str.charAt(check -= 1) +“, “); } else { System.out.print(str.charAt(0) + “, “); } } and the invocation: test(”four”); test(”tee”); test(”to”); What is the result?()
第2题:
collie
harrier
Compilation fails.
collie harrier
An exception is thrown at runtime.
第3题:
Cat
Dog
Compilation fails.
The code runs with no output.
An exception is thrown at runtime.
第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.
1
4
Compilation fails.
0
第8题:
r, t, t,
r, e, o,
Compilation fails.
An exception is thrown at runtime.
第9题:
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
第10题:
test end
Compilation fails.
test runtime end
test exception end
A Throwable is thrown by main 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题:
1
2
12
Compilation fails.
No output is produced.
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题:
test
Exception
Compilation fails.
NullPointerException
第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.
int Long
Compilation fails.
Short Long
第19题:
peep
bark
meow
Compilation fails.
An exception is thrown at runtime.
第20题:
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.
第21题:
Afoo Afoo
Afoo Bfoo
Bfoo Afoo
Bfoo Bfoo
Compilation fails.
An exception is thrown at runtime.
第22题:
7
49
343
Compilation fails.
An exception is thrown at runtime.
第23题:
Hello
Hello World
Compilation fails.
Hello World 5
The code runs with no output.
An exception is thrown at runtime.