+ 6

What is the purpose of using package in java?

23rd Jan 2017, 4:48 PM
Ahmed Shah Malik
Ahmed Shah Malik - avatar
2 Answers
+ 2
for organising purposes. like, how we put all our music in the music folder, videos in another, etc. similarly, we put classes with similar tasks in one package and the rest in others.
23rd Jan 2017, 4:51 PM
Nikunj Arora
Nikunj Arora - avatar
+ 1
its useful if you have jar file. then you can import it, without package name, it will not work as expected
1st Feb 2017, 5:30 PM
Mohsen
Mohsen - avatar