The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
August 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

default vs. public

Posted by john on August 31, 2000 at 11:05 AM

> In many books it is writen that if we donot put public in front of a variable then it is default access . But at the same time it is also written that public access and default access are the same thing . But i donot agree with this . So I want to ask that
> What is the difference between default and public access ?


Basically, DEFAULT means it's accessible only by classes within the same package, where's PUBLIC is accessible by classes inside (same as default), as well as outside the package.




Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us