Java Programs  «Prev 

Inside the Java API

The Java API (Application Programming Interface) is organized into a hierarchical structure like a tree. The root of this tree is the java package, which contains the core packages that provide the foundation for the rest of the API. Each package is a node in the tree and is organized based on its functionality. For example, the java.awt package contains classes for creating user interfaces, while the java.net package provides classes for networking.
Subpackages are branches in the tree that stem from their parent package. For instance, the java.util package has subpackages such as java.util.concurrent, java.util.function, and java.util.stream, each containing classes that deal with specific aspects of utility programming. Classes and interfaces are the leaves of the tree, and they are contained within their respective packages. Each class or interface has a unique name that distinguishes it from others, and it belongs to a particular package.
The tree-like structure of the Java API helps developers navigate and understand the organization of the vast library of classes and interfaces. It makes it easier to locate and use the appropriate classes and interfaces for a particular task or project. The packages that comprise the Java API are organized into a tree-like structure. This structure is evident in the names of the packages, which are hierarchical. As an example, the java.awt package contains the sub-packages
  1. java.awt.datatransfer,
  2. java.awt.event, and
  3. java.awt.image.

Package names are very important in Java because they serve as identifiers for groups of classes. In general, the standard Java API package names begin with java., which distinguishes them from user-created packages. Not surprisingly, you are not allowed to begin the name of your own packages with java.


java.applet 
java.awt 
java.awt.color 
java.awt.datatransfer 
java.awt.dnd 
java.awt.event 
java.awt.font 
java.awt.geom 
java.awt.im 
java.awt.im.spi 
java.awt.image 
java.awt.image.renderable 
java.awt.print 
java.beans 
java.beans.beancontext 
java.io 
java.lang 
java.lang.annotation 
java.lang.instrument 
java.lang.management 
java.lang.ref 
java.lang.reflect 
java.math 
java.net 
java.nio 
java.nio.channels 
java.nio.channels.spi 
java.nio.charset 
java.nio.charset.spi 
java.rmi 
java.rmi.activation 
java.rmi.dgc 
java.rmi.registry 
java.rmi.server 
java.security 
java.security.acl 
java.security.cert 
java.security.interfaces 
java.security.spec 
java.sql 
java.text 
java.util 
java.util.concurrent 
java.util.concurrent.atomic 
java.util.concurrent.locks 
java.util.jar 
java.util.logging 
java.util.prefs 
java.util.regex 
java.util.zip 
javax.accessibility 
javax.activity 
javax.crypto 
javax.crypto.interfaces 
javax.crypto.spec 
javax.imageio 
javax.imageio.event 
javax.imageio.metadata 
javax.imageio.plugins.bmp 
javax.imageio.plugins.jpeg 
javax.imageio.spi 
javax.imageio.stream 
javax.management 
javax.management.loading 
javax.management.modelmbean 
javax.management.monitor 
javax.management.openmbean 
javax.management.relation 
javax.management.remote 
javax.management.remote.rmi 
javax.management.timer 
javax.naming 
javax.naming.directory 
javax.naming.event 
javax.naming.ldap 
javax.naming.spi 
javax.net 
javax.net.ssl 
javax.print 
javax.print.attribute 
javax.print.attribute.standard 
javax.print.event 
javax.rmi 
javax.rmi.CORBA 
javax.rmi.ssl 
javax.security.auth 
javax.security.auth.callback 
javax.security.auth.kerberos 
javax.security.auth.login 
javax.security.auth.spi 
javax.security.auth.x500 
javax.security.cert 
javax.security.sasl 
javax.sound.midi 
javax.sound.midi.spi 
javax.sound.sampled 
javax.sound.sampled.spi 
javax.sql 
javax.sql.rowset 
javax.sql.rowset.serial 
javax.sql.rowset.spi 
javax.swing 
javax.swing.border 
javax.swing.colorchooser 
javax.swing.event 
javax.swing.filechooser 
javax.swing.plaf 
javax.swing.plaf.basic 
javax.swing.plaf.metal 
javax.swing.plaf.multi 
javax.swing.plaf.synth 
javax.swing.table 
javax.swing.text 
javax.swing.text.html 
javax.swing.text.html.parser 
javax.swing.text.rtf 
javax.swing.tree 
javax.swing.undo 
javax.transaction 
javax.transaction.xa 
javax.xml 
javax.xml.datatype 
javax.xml.namespace 
javax.xml.parsers 
javax.xml.transform 
javax.xml.transform.dom 
javax.xml.transform.sax 
javax.xml.transform.stream 
javax.xml.validation 
javax.xml.xpath 
org.ietf.jgss 
org.omg.CORBA 
org.omg.CORBA_2_3 
org.omg.CORBA_2_3.portable 
org.omg.CORBA.DynAnyPackage 
org.omg.CORBA.ORBPackage 
org.omg.CORBA.portable 
org.omg.CORBA.TypeCodePackage 
org.omg.CosNaming 
org.omg.CosNaming.NamingContextExtPackage 
org.omg.CosNaming.NamingContextPackage 
org.omg.Dynamic 
org.omg.DynamicAny 
org.omg.DynamicAny.DynAnyFactoryPackage 
org.omg.DynamicAny.DynAnyPackage 
org.omg.IOP 
org.omg.IOP.CodecFactoryPackage 
org.omg.IOP.CodecPackage 
org.omg.Messaging 
org.omg.PortableInterceptor 
org.omg.PortableInterceptor.ORBInitInfoPackage 
org.omg.PortableServer 
org.omg.PortableServer.CurrentPackage 
org.omg.PortableServer.POAManagerPackage 
org.omg.PortableServer.POAPackage 
org.omg.PortableServer.portable 
org.omg.PortableServer.ServantLocatorPackage 
org.omg.SendingContext 
org.omg.stub.java.rmi 
org.w3c.dom 
org.w3c.dom.bootstrap 
org.w3c.dom.events 
org.w3c.dom.ls 
org.xml.sax 
org.xml.sax.ext 
org.xml.sax.helpers