Java Program to Create a Package to Access the Member of External Class and Same Package
As the name suggests a package in java that contains all the same kinds of classes, Abstract classes, interfaces, etc that have the same functionality. A Single package can contain many classes, Abstract classes e.g. java.util package etc.
There are two types of packages:
- Built-in-package: These are the packages that are predefined in the java jar file. The most commonly used package in java. util and java.io package in java.
- User-defined package: These packages are created by the user that used to store related classes some other utility functions, interfaces and abstract classes, etc which are defined for the specific task is called a user-defined package.
Project -- GFG | | Package 1 GFG1 | GFG1.java (class) Package 2 GFG2 | GFG2.java (class) | GFG3.java (class)
Accessing the members of package 1 class in package 2 class:
My Personal Notes arrow_drop_up
Please Login to comment...