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.
Monday, February 17, 2014
About akash jain
Akash is a software developer with keen interest in software automation and dev-ops. When not coding, he is either busy browsing articles or reading anything or everything under this planet.
ocjp
Subscribe to:
Post Comments (Atom)
1 comment:
ankit.ete.2013@gmail.com
Post a Comment