Question: what is the use of getter and setter methods in apex?
Answer: Getter and Setter methods in salesforce. Getter and Setter methods in salesforce are used to pass data from controller to visualforce and vice versa.