Share on Google+Share on Google+

Package categories in Java

Package categories in Java

Package categories in Java


Java supports two types of packages as shown below in the hierarchy structure:

Build-In Packages in Core Java:

Java packages can be categorized in the hierarchy structure shown as:

Packages in the Java language begin with "java" or "javax" as we can found in both hierarchy structure shown above. Note that, the package "java" also has subpackages in which the package "awt" is further has a subpackage called "event" that is imported to access classes and interfaces to handle the events fired on the awt-component in a program. Thus the the expression to import the package is shown as"

import awt.event.*; 

Lets understand these java packages shown in the table, from which you can access interfaces and classes.

 Package Name  Description
 java.lang It contains essential classes that represent primitive data types (such as int & char) 
as well as more complex classes, including numerics, strings, objects, compiler, 
runtime, security, and threads. This is the only package that is automatically imported
 into every Java program. This package provides classes to manage input and output streams to read data from
 and write data to files, strings, and other sources.
 java.util It contains miscellaneous utility classes, including generic data structures, bit sets, time,
 date, string manipulation, random number generation, system properties, notification,
 and enumeration of data structures.
 java.awt It provides an integrated set of classes to manage user interface components such as 
windows, dialog boxes, buttons, checkboxes, lists, menus, scrollbars, and text fields. It provides classes for network support, including URLs, TCP sockets, UDP sockets,
 IP addresses, and a binary-to-text converter.
 java.applet It enables the programmer to create applets through the Applet class. It also provides
 several interfaces that connect an applet to its document and to resources for playing audio.
 java.nio This package handles New I/O framework for Java  
 java.math This package includes various mathematical operations. It is used for key generation, encryption and decryption.
 javax.swing It is used for hierarchy of packages for platform-independent rich GUI components.
 java.sql It provides classes to support connectivity from JDBC to access databases


Posted on: March 13, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Discuss: Package categories in Java   View All Comments

Post your Comment

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
June 12, 2011
computer science

write a java program to display my name,matric no., age, sex. what are the categories of java
ilupeju josiah oluwaseun
June 18, 2011
how to write java programs

pls try to explain in full details on how to write any java programs