Activity Forums Salesforce® Discussions Can we call an inner class from another class ?

  • shariq

    Member
    September 2, 2018 at 2:31 am

    Hi Anurag,

    Yes you can call inner class from another class. For example :-

    Class which contain inner class -

    public class ABC {
    public class DEF{
    public String xyz;
    public void ghi(){
    System.debug('IN==='+xyz);
    }
    }
    }

     

    Class which calls inner class of other class:-

    public class QWE {
    public void rty(){
    ABC.DEF obj = new ABC.DEF();
    obj.xyz = 'test';
    obj.ghi();
    }
    }

    Hope this helps.

     

     

     

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos