I'd almost put money on this one being homework related then again, if your test scores in your sig are legitimat, you wouldn't be getting this as a homework question, so here goes.
Why do we use packages?
It allows classes to be organised.
It means that two people can write a class with the same name BUT with different package names without there being any doubt which is which.
Personally, I dislike the old days when you could have litterally a few hundred source files in one folder, grouping things make it easier to understand. [ December 05, 2005: Message edited by: Darren Horsman ]
Joined: Aug 06, 2004
Darren this is not homework .
And I know the answer of this too . But I was just asking to know more from the people .
And for your info I have 1 1/2 yrs work exp. in J2EE . Can u see the lines below : they mean something .
At one level packages match folders on disk and serve just as a convenient way to organize files.
You can also manage dependencies and change at the package level. It's nice to have core packages that never changes while others might change with every release. I like Robert Martin's writings on this. Even though he says "package" as a generic "unit of deployment" rather than a literal Java package it's useful thinking. This blog is a good starting point. I wrote this for my team and contrast packaging for reuse and packaging for robustness.
You can manage visibility by package, too, such as package visibility classes. Sometimes it's nice to have public interfaces but keep implementation classes hidden from other packages. [ December 05, 2005: Message edited by: Stan James ]
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi