Monday, February 17, 2014

OCJP practice question

6:24 PM

E. The code compiles fine, so C is incorrect. The used field initializes to false and the make field initializes to null for the new Vehicle v. Therefore, line 7 is false and line 10 executes. Because v.make is a null reference, attempting to invoke its length method results in a NullPointerException at runtime. Therefore, the answer is E. 



© 2014 DieHardTechy . All rights resevered. Designed by Diehardtechy