Run the below code in developer console
List acc =[SELECT Id, Name FROM Account];
for(Account a : acc)
{
a.Name = a.Name.removeEnd(‘Updated’);
update a;
}
(Top 30 Salesforce Apex Interview Questions and Answers Pdf)
16. How do you pass the parameters from on apex class to another to another ?
Answer: You can simply pass the parameters through the URL.
say you are redirecting from one VF page to another
string value = ‘your param value’;
string url;
url = ‘/apex/VF_Page_Name?param1=’ + value;
PageReference pageRef = new PageReference(url);
pageRef.setRedirect(true);
return pageRef;
Then in the controller of the VF page, you just can get the param like this
String param_value = system.CurrentPageReference.GetParameters().get(‘param1’);