April 21, 2009 at 11:32 AM
Public Modifier- The public members can be accessed anywhere by any class or package.
Private Modifier- The private members can only be accessed within the class and cannot be accessed outside the class.
Protected Modifier- The protected members can be accessed within the class.It can also be accessible to the subclasses of the class in which the member is declared, that means, if any member is declared protected then all the methods and attributes of the base class will be available to all its derived classes.
Default - If no access modifier is being specified for a member, it gets the default access.It can be accessed within the package only.