The default package (the package with no name)
The current package
What does it mean by the default and the current pacakge?
In windows, the current directory IS the default (un-named) package and is the directory that you are sitting in when you compile. Therefore if there is any other class file in the same directory with you, you can access it without explicetly importing it.
(edited by Cindy to change "package" references to "directory" references )
[This message has been edited by Cindy Glass (edited May 17, 2001).]
For default package it seems to me that it is classes without package definition.
If i'am wrong tell me what i miss
From the JLS 7.4.2 Unnamed Packages
An implementation of the Java platform must support at least one unnamed package; it may support more than one unnamed package but is not required to do so. Which compilation units are in each unnamed package is determined by the host system.
In implementations of the Java platform that use a hierarchical file system for storing packages, one typical strategy is to associate an unnamed package with each directory; only one unnamed package is observable at a time, namely the one that is associated with the "current working directory." The precise meaning of "current working directory" depends on the host system.
Unnamed packages are provided by the Java platform principally for convenience when developing small or temporary applications or when just beginning development.