Java Certification Path - Class Access - Public Access

A class with the public modifier gives to all classes in all packages access to it. In other words, all classes can instantiate, extend or return a class of that type. Example:

package humanity;
public class Person {}

This class is visible to all classes in all packages. But if this class is in a different package, we need to import it yet.
Some exceptions exists, mainly when we use the nonaccess final modifier. I will explain soon.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Furl
  • Ma.gnolia
  • Reddit
  • Slashdot
  • Technorati
  • YahooMyWeb
  • BlinkList
  • Netscape
  • NewsVine
  • StumbleUpon
  • TailRank
  • blinkbits
  • blogmarks
  • BlogMemes
  • co.mments
  • DotNetKicks
  • MisterWong
  • Smarking

Leave a Reply