2 posts in topic
Flat View  Flat View

Posted By:   anup_ojah
Posted On:   Thursday, May 31, 2001 09:28 PM

can u please explain me what are packages and how they are created.

Re: packages

Posted By:   Luigi_Viggiano  
Posted On:   Friday, June 1, 2001 02:50 AM

Packages was early introduced by languages as Ada, and are used for keeping classes in groups to a sort of name space. In this way you can have a class named Account in the same application but in different context, like com.somebank.trading.Account, com.somebank.deposit.Account, com.somebank.regular.Account and so on... in this example a bank application could have different Accounts in different contexts.

Commonly packages should start with something like com.yourcompany, this is the naming convention for packages in Java, and is usefull to define an unique name space for big applications that can potentially be integrated with software from another company. Missusing this naming convention for package name you could fall in name collision, and could be an annoying problem...

So be aware of that and keep in mind that professional code follows this naming convetion even for little projects.

Re: packages

Posted By:   Anonymous  
Posted On:   Friday, June 1, 2001 02:06 AM

I suggest you to take a look at the Packages chapter of the Java Language Specifications.

It's a very simple explanation and it's coming from the "source".

About | Sitemap | Contact