Showing posts with label STATEMENT. Show all posts
Showing posts with label STATEMENT. Show all posts

Wednesday, 22 January 2014

PACKAGES AND INTERFACES

PACKAGES

Packages in java with example program

Packages are containers for classes. Packages help in avoiding naming conflicts.A package defines a name space for a set of classes that are related to each other. The name space defined by a package ensures that there are no two classes with the same name. But two packages can have a class with the same name without any name collision among them.We can define classes inside a package that are not accessible by code outside that package.One can also define class members that are only exposed to other members of the same package. This allows your classes to have intimate knowledge of each other, but not exposing that knowledge to the rest of the world.