Packages are used in Java in-order to prevent naming conflicts, to control access, to make searching/locating and usage of classes, interfaces, enumerations and annotations, etc., easier.
asked in Java 10 by (560 points)

2 Answers

Java packages can be stored in compressed files called JAR files.Allowing classes to download faster as a group rather than one at a time.Programmers also typically use packages to organize classes belonging to the same category or providing the same functionality.You can refer write my essay for more answers.

answered by (140 points)

Packages are important for giving flexibility of classes separation. They can be used for:

  • separating projects
  • separating modules
  • separating application layers (business, web, dao)
  • further finer grained code separation

For example


Could indicate the web layer of some module.

answered by

Java Interview Questions and Answers 2018