Types of packages
There
are two types of java package and they are:
·
Built
in package
·
User
define package
Fig: Types of Package |
1. Built-in-Packages:-
These packages consist of a large number of classes which are a part of Java API.Some of the commonly used built-in packages are:
Fig: Built in package |
1) java.lang: Contains language support classes(e.g classed which defines primitive data types, math operations). This package is automatically imported.
2) java.io: Contains classed for supporting input / output operations.
3) java.util: Contains utility classes which implement data structures like Linked List, Dictionary and support ; for Date / Time operations.
4) java.applet: Contains classes for
creating Applets.
5) java.awt: Contain classes for implementing the components for graphical user interfaces (like button , ;menus etc).
6) java.net: Contain classes for
supporting networking operations.
2. User-defined-packages:-
These are the packages that are defined by the user. First we create a directory myPackage (name should be same as the name of the package). Then create the MyClass inside the directory with the first statement being the package names.
No comments:
Post a Comment