Hi : I was just studying for the SCJP 1.4 exam..and reading some of the reference notes online...and it says:
# if no package declaration is found, the class or interface is made part of an unnamed package # every implementation of Java must provide for at least one unnamed package # most systems allow for one unnamed package per directory
i know that if you are running Windows..then java packages are in the form of directories...if the package is name. but what about if the package is not named...for example..you dont declare the package in your class file, that will compile as well..but then what is the "unnamed package" then in this case??
plz lemme know
please let me know
posted 11 years ago
Originally posted by dog lin:
# if no package declaration is found, the class or interface is made part of an unnamed package
If there is no package statement ( must be first line if there is ) in your source file it means that you are working in default project .
For more detail if your source file is in bin folder then you will compile your file like this :
and run like this :
And if suppose your have myPackage in the begining of your source file , then in the bin folder you may create one folder with name myPackage & put your source file in that folder .
for compilation :
for execution :
hope i have given lots of unnecessary details ...
[ January 08, 2005: Message edited by: rathi ji ] [ January 08, 2005: Message edited by: rathi ji ]