Keep it Rolling – Java

Moving towards Java generation

  • Top Clicks

    • None

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.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>