O'Reilly logo

SCJP Sun Certified Programmer for Java 6 Study Guide by Bert Bates, Kathy Sierra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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:

 

Image A is correct, a ClassCastException will be thrown when the code attempts to downcast a Tree to a Redwood.

 

Image B, C, D, E, and F are incorrect based on the above information.(Objective 5.2)

 

10. Given:

 

What is the result?

A.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required