Getter and Setter Method, we use to call apex method from Ajex without using remote action or RestResource API. We can directly retrieve values in a visualforce page from Apex controller. when we are using the keyword "Get" before a variable example "getCompnayName" now "Companyname" becomes the property of visualforce page, we can get any values that stored inside the Companyname variable. In apex Controller We should declare the getter and setter property in following way 1. public String myCompany {get; set;} 2. public String getmyCompany() { return "Everything is works"; } public String setmyCompany(String s) { return s; } 3. public String myCompany; public String getmyCompany() { return this.myCompany = "Everthing works fine" } public String setmyCompany(String s) { return this.myCompany = s; } 4. public void myactionfunction() { myCompany = "this is my name"; ...