Advantages of packages
Packages avoid the name clashes.
The Package provides easier access control.
We can also have the hidden classes that are not visible outside and used by the package.
It is easier to locate the related classes.
Advantages of Packages:
1.Programmers can easily define their own packages to bundle a group of classes/interfaces.
2.Using packages it is easier to provide access control.
3.Packages provide reusability of code.
4.It is also easier to locate related classes.
5.we can also import the available built in packages.
6.Since the package creates a new namespace there won't be any conflicts with names in other packages.
7.Packages are used to categorize the classes and interfaces so that they can be easily maintained.
Advantages of using packages in java
- Java package provides access protection.
- Java package removes naming collision.
- Java package is used to categorize the classes and interfaces so that they can be easily maintained.
- Packages provide reusability of code.
- To bundle classes and interfaces.
- We can create our own Package or extend already available Package.