Packages and Access Control
8 lessons in this section of the Java tutorial. Work through them in order, or jump to the one you need.
- 1.Package Concept
A package in Java is a namespace that groups related classes, interfaces, enums, and annotations into a logical unit.
- 2.Built-in Packages
Java ships with a rich standard library organised into packages under the java and javax namespaces.
- 3.User-defined Packages
User-defined packages are packages you create to organise your own application's classes and interfaces.
- 4.import
The import statement allows you to use a class, interface, or enum by its simple name rather than its fully qualified name.
- 5.Static Import
Static import allows you to access static members — static fields and static methods — of a class by their simple name without qualifying them with the class name.
- 6.Package Protection
Package protection refers to the package-private access level — the default access when no modifier (public, protected, or private) is written.
- 7.JAR Files
A JAR (Java ARchive) file is a compressed archive in ZIP format that packages compiled Java class files, resources (images, configuration files, properties), and…
- 8.Manifest File
The manifest file (META-INF/MANIFEST.MF) is a text file inside every JAR that contains metadata about the JAR and its contents.