Let’s learn about Java subpackages in this tutorial. A package is a collection of related classes, interfaces, and sub-packages. The package inside the package is called a subpackage.
Packages in Java allow the programmer to organize related classes, interfaces, and sub-packages in Java projects. On the computer filesystem packages are the folders or directories that contain the classes, interfaces, etc. Sub-packages are like subfolders created inside another folder. We can create a sub-package in a package to categorize the package further.
In this example, the top-level java is a package and the packages inside the package java are called sub-packages. Example sub-packages are awt, io, net, …, util.
The following awt, io, net,…, util packages are called sub-packages w.r.t to java because they reside inside the java package.
Java Tutorial on this website:
For more information on Java, visit the official website :