Sunday, 25 December 2022

Apex Access Modifiers | Access Modifiers in Apex Class Salesforce | Private Protected Public Global

                  In this post, we will see Apex Access Modifiers | Access Modifiers in Apex Class Salesforce | Private Protected Public Global 


Access Modifiers in Apex

1. Private

2. Protected

3. Public

4. Global


Accessibility Level

Private < Protected < Public < Global


Org1     AppExchange  Org2


Program Code: (Class A)

abstract public class A {

    protected integer A_val=3;

    

    public void A_show()

    {

        system.debug('Value of A_val:'+A_val);

    }


}

Program Code: (Class B)

public class B extends A

{

    public void B_show()

    {

        system.debug('Value of A_val:'+A_val);

    }


}

No comments:

Post a Comment