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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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(){; //what to use here, instead of or

    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
I know, hence the question.... – Lex Jan 25 '13 at 12:36
up vote 5 down vote accepted

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

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 :) – Phil Hawthorn Jan 25 '13 at 10:41

Your Answer


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.