Page 705 - AP Computer Science A, 7th edition
P. 705

34. (D) A NullPointerException is thrown whenever an attempt is made to invoke a method with an object that hasn’t been created with new. Choice A doesn’t make sense: To test the Caller constructor requires a statement of the form
Caller c = new Caller();
Choice B is wrong: A missing return statement in a method triggers a compile-time error. Choice C doesn’t make sense: In the declaration of numbers, its default initialization is to null. Choice E is bizarre. Hopefully you eliminated it immediately!
































































































   703   704   705   706   707