The keywords public, private and protected(also known as default*) are called as access modifiers. With the help of these access modifiers we can access to the variables which are declared inside a class and outside a method or a constructor.
*PUBLIC* : If the access modifier is public, then the variable declared with public can be accessed by any one through out the application.
*PRIVATE* : If the access modifier is private, then the variable declared with private can be accessed with in the class in which it was declared.
*PROTECTED* : If the access modifier is protected, then the variable declared with protected can be accessed with in the package only.
*NOTE* : The variables which are declared either in private or protected can be accessed by using a OOP concept called as Inheritance