Salesforce
PDII · Question #197
PDII Question #197: Real Exam Question with Answer & Explanation
Sign in or unlock PDII to reveal the answer and full explanation for question #197. The question stem and answer options stay visible for context.
Question
A Visualforce Page throws an 'Attempt to dereference a null object' error for a Contact. What change in the controller will fix the error?
Options
- AUse a condition in the getter to return a new Contact if it is null
- BDeclare a static final Contact at the top of the controller
- CChange the getter's signature to be static Contact
- DChange the setter's signature to return a Contact
Unlock PDII to see the answer
You've previewed enough free PDII questions. Unlock PDII for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.