private, public, protected, global and T protected:-This means that the method or variable is visible to any inner classes in the defining Apex class, and to the classes that extend the defining Apex class. You can only use this access modifier for instance methods and member variables.
Private
Method level
There are 4 access modifiers,
Global, Public, Protected and Private
Protected access modifiers can be used for methods and variables inside the class.
private, public, protected, global and T
protected:-This means that the method or variable is visible to any inner classes in the defining Apex class, and to the classes that extend the defining Apex class. You can only use this access modifier for instance methods and member variables.
global
Public, private, global
Private is method level
Use that for only particular method