• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Default Class Access ?

 
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello all,
"A class with default access can be seen only by classes within the same package".
When you say DEFAULT PACKAGE, does this mean on the same directory/location?
Thanks all.
Cyrus,
 
Ranch Hand
Posts: 1143
1
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Cyrus,
[We meet again ]
The "default package" is the "unnamed package". Any java source code file that does not contain a package specification, i.e. the first non-comment line in the source code file is NOT

is considered to be in the "default" package, and its location is determined by the CLASSPATH setting(s).
For example, if your CLASSPATH (on a Windows machine) is:

then java "class" files in this directory (that don't contain a package specification) are considered to be in the "default" package.
Hope this answers your question.
Good Luck,
Avi.
P.S. By the way, do you know about these (excellent, in my opinion) java resources:
SUN Java Tutorial
Thinking in Java
Safari online library
[ November 18, 2003: Message edited by: Avi Abrami ]
 
Cyrus Serrano
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello AVI,
thanks for the relentless response ( in my opinion )

sometimes, when reading books it tends to bore you, but i dont have a choice, "READ ON" as sierra and bert commented on their book.
can you recommend any free readables online for me to learn Java, i wish to learn how to create a program in an OOP way. a couple of local books in our country simply, defines what is OOP, but lacks examples on how PROGRAM should be structured.
currently im an instructor and finding ways how could i teach Java in a simple but effective way.
thanks again..
Cyrus
[ November 21, 2003: Message edited by: Cyrus Serrano ]
 
It is an experimental device that will make my mind that most powerful force on earth! More powerful than this tiny ad!
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!