Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (1.5k points)
recategorized ago by
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

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...