function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Raghavendra ARaghavendra A 

Get and Set Methods

Hello All,

Could someone explain the differnece of using the Get and Set methods in Apex/Visualforce page developement? 

I am always confused on how to use these methods. It would be great if someone can give an example to me!

Thanks a lot in advance!

Regards,
Raghu
Best Answer chosen by Raghavendra A
Jen BennettJen Bennett
Found a link that explains the getter and setter methods:
http://www.forcetree.com/2009/07/getter-and-setter-methods-what-are-they.html

All Answers

Jen BennettJen Bennett
Found a link that explains the getter and setter methods:
http://www.forcetree.com/2009/07/getter-and-setter-methods-what-are-they.html

This was selected as the best answer
Michael VerhovskiMichael Verhovski
Examples of Visualforce Page Execution Order (http://www.salesforce.com/us/developer/docs/pages/Content/pages_controller_lifecycle_example.htm) docuemnt is a good read with a lot of examples
Vidhyasagaran MuralidharanVidhyasagaran Muralidharan
Hi Raghu,

Just go through above link.In order to give you a easy and understandable way

Get:it will take value from controller and passed it to VF page.

whereas Set:It willtake value from the VF page and use it in the Controller.
Ex:inputfield  present in VF page, if we type something and we can use it in controller and do some business logic over there
Raghavendra ARaghavendra A
Thanks a lot, Guys!