Name
Package java.lang
Synopsis
The java.lang package, whose class hierarchy is
shown in Figure 12-1, contains the classes that form the
core of the Java language API. The CLDC version of this package contains
just under half of the classes and interfaces of its J2SE counterpart. The major
omissions are:
Most of the
Errorclasses, which are not required because the CLDC VM does not support them. Some of the J2SEExceptionclasses are also omitted.The
FloatandDoubletypes, omitted because the VM does not provide floating point operations.Various other classes such as
ClassLoader,SecurityManagerandStrictMathwhich are not needed because the associated functionality is not part of the CLDC specification.
The most fundamental classes in this package are Object,
Class and Throwable.
Object is the base class for all Java objects. The CLDC
Object class provides most of the methods of its J2SE
counterpart, with the notable exceptions of clone() and
finalize(), which are omitted because neither cloning nor
finalization is supported in the CLDC Java virtual machine.
Class contains the information used to manage a class in
the Java virtual machine. The CLDC version of this class does not contain
the methods from the J2SE version that are related to reflection, again
because reflection is not provided by the CLDC virtual machine.
Throwable is the base class for all Java exceptions.
Throwable has two subclasses, Exception
and Error, that are the roots of separate class hierarchies ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access