Understanding Packages and Interfaces in Java
page 2 of 11
by Debjani Mallick
Feedback
Average Rating: 
Views (Total / Last 10 Days): 22439/ 283

Packages

Packages in Java are nothing more than a way to organize the files into different directories according to the functionality, category, etc. Just as files in one directory will have different functionality from those of another directory, files in one package will have a different functionality from the files in a different package. For example, files in java.io package contain functionality related to I/O, but the files in java.net package contain functionality related to a network. Package is a collection of classes that avoids name space collision. For example, if we have a class named “Vector” this name would clash with the “Vector” class present in JDK (Java Development Kit), but in real life this never happens as JDK “Vector” class is present in java.util package which is a separate package. So we can create a Vector class simply or we can put it in some other package, but we cannot create multiple classes having the same name in a single package. However, we can create a class hierarchy and keep them in a package. Packages can also be considered as a container for classes.


View Entire Article

Article Feedback

Title:  
Name:  
Url: ( Optional )
Comment:  
Please add 8 and 5 and type the answer here:

User Comments

Title: package   
Name: puja
Date: 1/27/2010 11:05:13 AM
Comment:
can give more information about advantages of packages.
Title: Mistake   
Name: Gyandeep
Date: 11/19/2009 5:16:23 AM
Comment:
Ma'am, you have made a slight mistage here. The refernce variable you have used d takes r to its account and prints r.area(). It should be d.area. In the main().

Thanks and cheers!
Title: Interfaces and packages   
Name: Tamkeen
Date: 7/7/2009 2:55:10 AM
Comment:
Very precise and easily understandable language.
Title: package   
Name: Duraipandi
Date: 10/14/2008 7:34:39 AM
Comment:
It is very nice.here syntax and examples are each and every thing fine.
Title: very nice elaboration   
Name: Regalla Naresh Reddy
Date: 6/10/2008 3:36:05 AM
Comment:
Its vey nice.If you include syntax and an exmaple on syntax looks very nice.So try it
Title: doubt   
Name: raghavendra
Date: 3/15/2008 3:01:11 AM
Comment:
i have created a package named account and i created a new folder name test inside test i written a java program to access the package account.. its saying package account not found.. kindly help me.. if any..
Title: very nice   
Name: antony
Date: 1/22/2008 6:14:33 AM
Comment:
its very very useful for beginers.so thanks for you.and also i want more in swing and awt etc
Title: Nice   
Name: Ed
Date: 8/12/2007 10:34:37 PM
Comment:
NICE ARTICLE
Title: Good work   
Name: Rick
Date: 8/10/2007 10:50:14 PM
Comment:
It is a good piece of work.
Title: I have not gone thru the article :)   
Name: Sandeep Acharya
Date: 8/10/2007 9:45:29 AM
Comment:
Hello,
How many articles do you have in pipeline?? Sorry, but I have not gone thru the article as I am sure I ll not get anything from that ;)...BTW carry on ur good work and whats abt the treat??? $ mein chk aaya ya nahin???

Product Spotlight
Product Spotlight 






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2010 ASPAlliance.com  |  Page Processed at 3/12/2010 6:25:05 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search