What is the result? (Choose all that apply.)
A. An exception is thrown at runtime
B. The code compiles and runs with no output
C. Compilation fails with an error at line 8
D. Compilation fails with an error at line 9
E. Compilation fails with an error at line 12
F. Compilation fails with an error at line 13
Answer: |
|
A is correct, a ClassCastException will be thrown when the code attempts to downcast a Tree to a Redwood. |
|
B, C, D, E, and F are incorrect based on the above information.(Objective 5.2) |
10. Given:
What is the result?
A.
Get SCJP Sun Certified Programmer for Java 6 Study Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.