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

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 5 and 4 and type the answer here:

User Comments

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 
Learn More
.NET Tools
asp.net shopping cart
asp.net chart control






Ads Powered by Lake Quincy Media
Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2008 ASPAlliance.com  |  Page Processed at 7/5/2008 1:30:21 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search