Java package: Difference between revisions

Content deleted Content added
The mechanism works even if the source files aren't "belonging to the same category or providing similar functionality "
Two reasons you might use a package - including the one I deleted a moment ago
Line 1:
A '''Java package''' is a mechanism for organizing [[Java (programming language)|Java]] [[class (computer science)|classes]] into [[namespace (computer science)|namespaces]]. Java packages can be stored in compressed files called [[sourceJAR file]]s, canallowing includeclasses ato '''<code>package</code>'''download statementfaster atas thea topgroup ofrather thethan fileone toat designatea thetime. packageProgrammers foralso thetypically classesuse thepackages sourceto fileorganize defines.classes belonging Javato packagesthe cansame becategory storedor inproviding compressedsimilar filesfunctionality. called [[JAR file]]s.
 
Java [[source file]]s can include a '''<code>package</code>''' statement at the top of the file to designate the package for the classes the source file defines.
 
* A package provides a unique namespace for the types it contains.