Java Lec-27 Package - Dbaf88a
Java Lec-27 Package - Dbaf88a
Java Lecture-27
Topic: Packages
Package
In small projects, all the java files have unique names. So, it is not difficult
to put them in a single folder.
But, in the case of huge projects where the number of java files is large, it is
very difficult to put files in a single folder because the manner of storing
files would be disorganized.
Moreover, if different java files in various modules of the project have the
same name, it is not possible to store two java files with the same name in
the same folder because it may occur naming conflict.
Package in Java
A package is nothing but a physical folder structure (directories) that
contains a group of related classes, interfaces, and sub-packages according
to their functionality.
It provides a convenient way to organize your work. The Java language has
various in-built packages.
For example, java.lang, java.util, java.io, and java.net. All these packages
are defined as a very clear and systematic packaging mechanism for
categorizing and managing.
Course: Java Programming, Info Planet Programming Classes Prepared By: Atul Kabra, 9422279260
Course: Java Programming, Prepared By: Atul Kabra, 9422279260
2. User-defined Package
The package which is defined by the user is called a User-defined
package. It contains user-defined classes and interfaces.
Course: Java Programming, Info Planet Programming Classes Prepared By: Atul Kabra, 9422279260