Back

Explore Courses Blog Tutorials Interview Questions

Explore Tech Questions and Answers

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

0 votes
2 views
by (1.5k points)
I am new to Java and i wanted to ask that what is the advantages and disadvantages of using packages in Java?

What is the necessity of use packages?

1 Answer

0 votes
by (1.4k points)

Following are the advantages of using packages in Java: 

  • The package creates a new namespace so there won't be anname conflicts with names in other packages. 

  • Programmers can define their own packages to bundle a group of classes/interfaces, etc. 

  • Packages helps to provide access control 

  • Comparatively easily to locate the related classes 

Related questions

0 votes
1 answer
asked Oct 17, 2019 in Java by Anvi (10.2k points)
0 votes
1 answer
0 votes
1 answer

Browse Categories

...