Google News
logo
Salesforce - Interview Questions
What is an Access Modifier in a Program?
Apex uses access modifiers for defining methods and variables. These are private, protected, global or public access modifiers.

To use the private, protected, public, or global access modifiers, use the following syntax:
[(none)|private|protected|public|global] declaration
For example :
// private variable s1
private string s1 = '1';

// public method getsz()
public string getsz() { 
   ... 
}
Advertisement