Activity Forums Salesforce® Discussions How do we call the inner class from the parent class in Salesforce?

  • Avnish Yadav

    Member
    July 19, 2018 at 12:22 pm

    Hello Anurag,

    You can call inner inside your outer class by making object of inner class (not for static methods or static variables).

    Example:

    public class OuterClass{

       // do some task

        InnerClass obj = new InnerClass();

        public class InnerClass {

        //do some task

        }

    }

     

    Thanks.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos