Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

What is the equivalent of this when calling a static method in Apex, besides the class name?

For instance

class A {
    public static void foo(){
        this.bar(); //what to use here, instead of this.bar() or A.bar()
    }

    private static void bar(){
        //some stuff
    }
}
share|improve this question
    
this doesn't work in static methods –  Pramod Kumar Jan 25 '13 at 11:37
1  
I know, hence the question.... –  Lex Jan 25 '13 at 12:36
add comment

1 Answer

up vote 3 down vote accepted

You would simply omit the 'this' and call it as follows:

bar();
share|improve this answer
    
So obvious... Thanks. –  Lex Jan 25 '13 at 10:39
    
no problem...sometimes you can't see the wood for the trees :) –  user293 Jan 25 '13 at 10:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.