Posts

Showing posts from September, 2015

Packages

Image
Package: A collection of related .class files.[We know that the .class files can be generated to both classes and interfaces.So, we can say a package as a collection of classes and interfaces]. -A package specifies a new namespace,where we can place our own related files. -Modularity is supported with packages. -Java supports 2 kinds of packages: Built-in packages User defined packages Built-in packages: Comes with java software. Ex: java.io, java.util, java.net, java.awt..etc., All these packages support and provide the corresponding predefined functionalities which are helpful to develop applications. Ex: java.io----> for handling input/output operations. User defined packages: These are created by us. Creating a user defined package:       Use the following syntax:                              package package_name;  Note: This statement must be kept as a first ...