The Java Language Package

The Java Language Package

The Different Java Packages
Eight packages comprise the standard Java development environment.

The Java language package, also known as java.lang, contains classes that are core to the Java language. The classes in this package are grouped as follow:

Object
The grand-daddy of all classes–the class from which all others inherit.

Data Type Wrappers
A collection of classes used to wrap variables of a primitive data type: Boolean, Character, Double, Float, Integer and Long. Each of these classes are subclasses of the abstract class Number.

Strings
Two classes that implement character data. is a thorough lesson on the use of both types of strings.

System and Runtime
These two classes provide let your programs use system resources. System provides a system-independent programming interface to system resources and Runtime gives you direct system-specific access to the runtime environment.

Threads
The Thread, ThreadDeath and ThreadGroup classes implement the multi-threading capabilities so important to the Java language. The java.lang package also defines the Runnable interface. Runnable makes it convenient for Java class to be active without subclassing the Thread class.

Classes
The Class class provides a runtime description of a class and the ClassLoader class allows you to load classes into your program during runtime.

Math
A library of math routines and values such as pi.

Exceptions, Errors and Throwable
When an error occurs in a Java program, the program throws an object which indicates what the problem was and the state of the interpreter when the error occurred. Only objects that derive from the Throwable class can be thrown. There are two main subclasses of Throwable: Exception and Error. Exceptions are a form of Throwable that “normal” programs may try to catch. Errors are used for more catastophic errors–normal programs should not catch errors. The java.lang package contains the Throwable, Exception and Error classes, and numerous subclasses of Exception and Error that represent specific problems.

Processes
Process objects represent the system process that is created when you use Runtime to execute system commands. The java.lang packages defines and implements the generic Process class.

The compiler automatically imports this package for us. No other packages are automatically imported.

Scroll to Top