What is meant by packages

Showing Answers 1 - 6 of 6 Answers

reena sahoo

  • Sep 1st, 2005
 

package is a name space where all classes stores.

  Was this answer useful?  Yes

ksreddy

  • Dec 1st, 2005
 

       package is group of related classes and interface

  Was this answer useful?  Yes

yazhini

  • Dec 14th, 2005
 

A package is nothing but a collection of classes which may contain frequently used methods.It is used to reduce the number of lines of the program.It is enough to write one or more than one classes under one package and we can make use of the methods in other Programs by just importing the package. * To create a package create a subdirectory with the same name of the package. *Write the desired classes and save this program under the subdirectory of that package.ex: //Creating A package Package MyPackage; public class Pac { void add() { int a=10; int b=10; int c=a+b; System.out.println( "Sum="+c); }}Save this program under("rootdirectory/MyPackage/Pac.java"); //Implementing the package import java.MyPackage.*; public class ImPackage extends Pac { public static void main(String args[]) { Pac p = new pac(); p.add(); } }

  Was this answer useful?  Yes

Ajitha

  • May 7th, 2012
 

Package is a containers which contains collection of classes and methods.

  Was this answer useful?  Yes

Prashant Wayal

  • Oct 19th, 2012
 

A package is a container which consists of classes and interfaces.

  Was this answer useful?  Yes

krish

  • Oct 31st, 2012
 

packages is nothing but Classes and Interfaces and sub-packages.
Sub-packages is nothing but Classes and Interfaces and sub-sub-packages.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions