Google News
logo
Salesforce - Interview Questions
Can you write Getter and Setter Methods in Salesforce?
Yes, we can use a getter method to return values for a controller. Every value calculated by a controller and displayed on a page must have a getter method.
 
On the other hand, the setter method is used for passing user-specified values from page mark up to the controller. The setter method in a controller is automatically executed, before any actions.
Advertisement