public class controller2
{
public static string method2(string parameter1, string parameter2) {
// put your static code in here
return parameter1+parameter2;
}
...
}
controller1.cls
public class controller1
{
...
public void method1() {
string returnValue = controller2.method2('Hi ','there');
}
}
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Yes we can override, Please follow below code
controller2.cls controller1.cls
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
Hi Girish,
Yes we can overide the static method in apex. For more information refer the below article :-
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_static.htm
Also check this similar example :-
https://salesforce.stackexchange.com/questions/82938/how-do-i-override-an-inherited-static-remote-method-in-apex-or-visualforce
If the above information helps you, please mark it as best answer.
Regards,
Priya Ranjan