← 返回首页
java.lang (Java SE 26 & JDK 26)
JavaScript is disabled on your browser.
Contents
  1. Description
    1. Character Encodings
  2. Related Packages
  3. Classes and Interfaces
Hide sidebar  Show sidebar

Package java.lang

package java.lang
Provides classes that are fundamental to the design of the Java programming language. The most important classes are Object, which is the root of the class hierarchy, and Class, instances of which represent classes at run time.

Frequently it is necessary to represent a value of primitive type as if it were an object.The wrapper classes Boolean, Byte, Character, Short, Integer, Long, Float, and Double serve this purpose. An object of type Double, for example, contains a field whose type is double, representing that value in such a way that a reference to it can be stored in a variable of reference type. As discussed in The Java Language Specification, the wrapper classes are involved in boxing (JLS 5.1.7) and unboxing (JLS 5.1.8) conversions. These classes provide a number of methods for converting among primitive values, as well as methods supporting such standard functionality as equals and hashCode. The Void class is a non-instantiable class that holds a reference to a Class object representing the type void.

The class Math provides commonly used mathematical functions such as sine, cosine, and square root. The classes String, StringBuffer, and StringBuilder similarly provide commonly used operations on character strings.

Classes ClassLoader, Process, ProcessBuilder, Runtime, and System provide "system operations" that manage the dynamic loading of classes, creation of external processes, and host environment inquiries such as the time of day.

Class Throwable encompasses objects that may be thrown by the throw statement. Subclasses of Throwable represent errors and exceptions.

Character Encodings

The specification of the java.nio.charset.Charset class describes the naming conventions for character encodings as well as the set of standard encodings that must be supported by every implementation of the Java platform.
Since: 1.0

Scripting on this page tracks web page traffic, but does not change the content in any way.