CoolInterview.com - World's Largest Collection of Interview Questions
Send Free SMS
 Interview Questions  
 Our Services  


INTERVIEW QUESTIONS J2EE JAVA DETAILS
Question :
What is package? Define with example?

Posted by: Karethikeyan.K on 5/27/2008

Contact Karethikeyan.K  Contact Karethikeyan.K
Category Java Interview Questions
Rating (4.7) By 26 users
Added on 5/27/2008
Views 1690
Rate it!
Answers:

A package is a grouping of related types providing access protection and name space management. Note that types refers to classes, interfaces, enumerations, and annotation types. Enumerations and annotation types are special kinds of classes and interfaces, respectively, so types are often referred to in this lesson simply as classes and interfaces.



 Posted by: manoj    

Contact manoj  Contact manoj

Package is a directory of related classes and interfaces.

Eg: java.lang.*

Here java is a directory,lang stands for language & it is a sub directory, * indicates collection of related classes & interfaces



 Posted by: P.Naren Kumar Reddy    

Contact P.Naren Kumar Reddy  Contact P.Naren Kumar Reddy

Packages are Java?s way of grouping a variety of classes / interfaces together.
The classes contained in the packages of other programs can be easily reused.
In packages, classes can be unique compared with classes in other packages. Thus, two classes in two different packages can have the same name.
Packages provide a way to hide classes thus preventing other programs or packages from accessing classes that are meant for internal use only.
for example - java.lang
java.util



 Posted by: Anu Sharma    

Contact Anu Sharma  Contact Anu Sharma

Package is a collection of .class files and java files
2)all the files in the package must be public.
3)the file must contain the keyword as "package".
4)a package can contain subpackege
5)we can use the classes in package by using import keyword.



 Posted by: Manish Sahni    

Contact Manish Sahni  Contact Manish Sahni

Packages are group of inter-related classes.eg-In math class we can do addition ,subtractionetc.
example of classes are:java.applet
which is used for implementing and creating applets.



 Posted by: uma shankar pandey    

Contact uma shankar pandey  Contact uma shankar pandey

packages contain combination of methods and classes.there are many packages available ex:util,io,net,awt etc



 Posted by: Dinesh    

Contact Dinesh  Contact Dinesh


If you have the better answer, then send it to us. We will display your answer after the approval.
Name :*
Email Id :*
Answer :*
Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
Process Verification  Enter the above shown code:*
Inform me about updated answers to this question

   
Related Questions
View Answer
If my java based application is hanging once in a while. Where would you start looking at the problem, what changes can you do?

My application has a builtin Ldap client and is communicating with a Ldap server. now having a problem with the authentication, how should i start troubleshooting? I, being responsible for the application and the OS, what can i do?
View Answer
How to invoke the primitive types within object in arraylist?
View Answer
String class can be extendable? and why?
View Answer
What is the difference between attribute and parameter ?
View Answer
What is the difference between length and length() ?
View Answer
What is the difference between concat and append?
View Answer
What is the difference between Java and J2EE? Is J2EE advanced version of Java?
View Answer
How do u create objects at runtime?
View Answer
What is a string Handling? How to use it? what is difference b/w Event handling?
View Answer
What is multi threading ?
View Answer

Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

Notify me when better answer is posted!
Email:

View ALL Java Interview Questions

User Options
Sponsored Links


Copyright ©2003-2010 CoolInterview.com, All Rights Reserved.
Privacy Policy | Terms and Conditions
Page URL: http://www.coolinterview.com/interview/15284/default.asp?cachecommand=bypass


Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Free SMS | Dedicated Servers | Joke of the Day

1.36