Package : It is collection of more than one class files. There are two types of packages available in Java language as given below.
- Same package (Default Package)
If the required class files and class file of main program are present in same folder, then such concept is known as concept of same package or default package in which all the class files are automatically linked with each other during the runtime of program.
- Different package
If all the required class files and the class file of main program are present in two different folders then such concept is known as concept of different package in which all the class files will not automatically link with each other but we can link them by using import keyword.
Applications of Package
- To separate the modules of project.
- To differentiate each logical entity of project.