Java: Controlling access to members of a class
Posted by rolloutjava on January 15, 2008
‘public’: Class is visible to all classes everywhere. If a class has no modifier, it is visible only within its own package.
Member-level access modifiers: For members of a class there are two more modifiers, private and protected. ‘private’ specifies that the member can only be accessed in its own class. ‘protected’ specifies that the member can only be accessed within its own package and by a subclass of its class in another package.