What is mean by packages in java?

What is mean by packages in java?

Packages are the container for the classes.

 A single package may contain several classes and sub packages.

 Java provides the keyword \'package\' to declare the package. Each package has an identifier and can be import in the other package.

 Packages are introduced to resolve the class naming confliction that can arise when two programmers have the same name for their classes.Declaring a package:package p1;class abc{}Importing a package:package p2;import p1.abc;class xyz{}


By:Jalees
Date:2012-01-09 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related Java Subjective Links

Java Subjective interview questions and answers for experienced and fresher