Java Package is used to group related classes . avoiding name conflicts: (two classes with the same name can exist in different packages). Reusability: packaged code can be imported and used anywhere. Packages are divided into two categories; Build in packages(Packages from the java API User-defined Packages (create your own packages) Build in Package: Built-in Packages comprise a large number of classes that are part of the Java API. Some of the commonly used built-in packages are: java.lang: Contains language support classes java.io: Contains classes for supporting input/output operations. java.util: Contains utility classes that implement data structures such as Linked Lists and Dictionaries, as well as support for date and time operations. java.applet: Contains classes for creating Applets. java.awt: Contains classes for implementing the components for graphical user interfaces (like buttons, menus, etc).…