Module Overview
This module introduces packages and access modifiers in Java, helping learners understand how classes and related components are organised within a Java application.
It covers built-in and user-defined packages, importing packages and controlling access to class members.
Learners will explore the four access levels—public, private, protected and default—and understand how they determine the visibility of classes, methods and variables.
The module also introduces static imports, which simplify access to static members from other classes.
These concepts help learners organise application code, manage accessibility and develop structured, maintainable Java projects.
What Will Be Covered
11.1 Built-in Packages
Understanding the purpose of packages in Java.
Exploring built-in Java packages.
Learning about commonly used packages such as java.lang, java.util and java.io.
Understanding how packages group related classes and interfaces.
Exploring classes and methods available in standard Java libraries.
Using built-in packages to simplify application development.
11.2 User-Defined Packages
Understanding the concept of user-defined packages.
Creating custom packages using the package keyword.
Organising Java classes into packages.
Defining classes within user-created packages.
Understanding package naming conventions.
Using user-defined packages to organise application components and improve code reusability.
11.3 public, private, protected and default
Understanding access modifiers in Java.
Exploring the purpose of the public access modifier.
Restricting access using private.
Understanding protected access within inheritance and package relationships.
Exploring default access when no modifier is specified.
Comparing the visibility of class members across packages.
Selecting appropriate access modifiers to control data and method accessibility.
11.4 Importing Packages
Understanding why packages need to be imported.
Using the import statement to access classes from other packages.
Importing individual classes.
Importing multiple classes from a package using the wildcard (*).
Understanding the difference between importing a package and importing a specific class.
Using imported classes in Java programs.
11.5 Static Import
Understanding the purpose of static imports.
Using the import static statement.
Accessing static methods without specifying the class name.
Accessing static variables from other classes.
Understanding single static imports and wildcard static imports.
Applying static imports to simplify Java code.
Skills You Will Gain
Understanding Java package structures.
Working with built-in Java packages.
Creating and organising user-defined packages.
Applying public, private, protected and default access modifiers.
Controlling access to classes, methods and variables.
Importing individual classes and packages.
Using static imports to access static members.
Organising Java projects into manageable components.
Improving code structure and maintainability.
Learning Outcomes
By the end of this module, learners will be able to:
Organise Java application components into packages for easier maintenance and development.
Use built-in Java libraries to implement common application functionality.
Create user-defined packages to structure business application components.
Apply access modifiers to control visibility and protect application data.
Select suitable access levels when designing classes, methods and variables.
Import required classes and packages when developing Java applications.
Use static imports to simplify access to commonly used static members.
Develop organised Java projects with clear package structures and controlled member accessibility.
Certification Alignment
This module develops Java package management and access control knowledge that supports the broader learning pathway towards the Oracle Certified Professional: Java SE 17 Developer certification.
The topics covered help learners understand packages, imports, access modifiers and class visibility within Java application development.
Continue to the Next Module
Continue to Module 12: Exception Handling to learn how Java manages runtime errors and unexpected situations using try, catch, finally, throw, throws and custom exceptions.
Still need help?
Contact us