Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does salesforce Apex support inheritance of static methods?

public virtual class parent {
    public static void doStuff(){system.debug('stuff');} 
}

public class child extends parent{}

When I call

child.doStuff();

I get this error: Method does not exist or incorrect signature: child.doStuff()

Are static methods not inherited in salesforce or am I doing something wrong?

like image 222
naomi Avatar asked Feb 15 '12 13:02

naomi


1 Answers

Apex is consistent with Java on this. Statics are not inherited.

like image 178
Jeremy Ross Avatar answered Oct 22 '22 14:10

Jeremy Ross