Salesforce Platform Developer I (legacy) — Question 287
Which two statements are true about Getter and Setter methods? (Choose two.)
Answer options
- A. Setter methods always have to be declared global.
- B. Setter methods are required to pass a value from a page to a controller.
- C. There is no guarantee for the order in which Getter or Setter methods are executed.
- D. Getter methods can pass a value from a controller to a page.
Correct answer: C, D
Explanation
The correct answers are C and D because there is no defined sequence for executing Getter and Setter methods (C), and Getter methods are specifically used to pass values from controllers to pages (D). Options A and B are incorrect because Setter methods do not have to be global, and they are not always required to pass values from pages to controllers.