Package

Package :  It is collection of more than one class files. There are two types of packages available in Java language as given below.

  1. 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.

  1. 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

  1. To separate the modules of project.
  2. To differentiate each logical entity of project.

Leave a Reply

Your email address will not be published. Required fields are marked *