Access Modifiers
Public: if the method or variable must be visible to all classes, then it must declared as public.
Private: It is narrowly visible and highest level of protection. Private methods and variables cannot seen by any class other than the one in which they are defined.
Protected: This modifier is a relationship between a class and its present and future subclasses.
Package: package is indicated by the lack of any access modifier in a declaration. It has an increased protection and narrowed visibility
Private: It is narrowly visible and highest level of protection. Private methods and variables cannot seen by any class other than the one in which they are defined.
Protected: This modifier is a relationship between a class and its present and future subclasses.
Package: package is indicated by the lack of any access modifier in a declaration. It has an increased protection and narrowed visibility