####Header Apex has four different access modifiers when you define your classes and triggers and the subsequent methods and variables.
- Private
- The default and most used access modifier. A method or variable with the modifier is only accessable within the Apex class (or trigger) in which its defined.
- Protected
- This one is a little more open than Private. A method or variable with the Protected modifier is only accessable to any inner classes of the defining Apex and to classes that extend the defining Apex class.
- Public
- One step up from Protected! (see the pattern?) Methods or variables with the Public modifier can be used by any Apex in the application or namespace (basically by within anything in your Salesforce org).
- Global
- The most open of them all! A method or variable with the Gobal modifier can be referenced outside the application or even your Salesforce org via the SOAP API. If you decalre a method or variable as global, the class that it's contained within must be declared Global as well.
######For more information reference the offical Salesforce/Apex documentation.