java lang package
java.lang Package in Java
java.lang package 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.
Wrapper Classes in Java
Frequently it is necessary to represent a value of primitive type as if it were an object. The wrapper classes Boolean, Character, 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. These classes also provide a number of methods for converting among primitive values, as well as supporting such standard methods as equals and hashCode.
Wrapper classes in Java as follows.
- Boolean : The Boolean class wraps a value of the primitive type boolean in an object.
- Byte : The Byte class wraps a value of primitive type byte in an object.
- Character : The Character class wraps a value of the primitive type char in an object.
- Short : The Short class wraps a value of primitive type short in an object.
- Integer : The Integer class wraps a value of the primitive type int in an object.
- Float : The Float class wraps a value of primitive type float in an object.
- Long : The Long class wraps a value of the primitive type long in an object.
- Double : The Double class wraps a value of the primitive type double in an object.
Mathematical Operations Classes in Java
The class Math provides commonly used mathematical functions such as sine, cosine, and square root. Mathematical classes in Java as follows.
- Math : The class Math contains methods for performing basic numeric operations such as the elementary exponential, logarithm, square root, and trigonometric functions.
- StrictMath : The class StrictMath contains methods for performing basic numeric operations such as the elementary exponential, logarithm, square root, and trigonometric functions.
String Operations Classes in Java
The classes String, StringBuffer, and StringBuilder similarly provide commonly used operations on character strings. String class in Java as follows.
System Operations Classes in Java
Classes ClassLoader, Process, ProcessBuilder, Runtime, SecurityManager, and System provide "system operations" that manage the dynamic loading of classes, creation of external processes, host environment inquiries such as the time of day, and enforcement of security policies.
System operations classes in Java as follows.
- ClassLoader : A class loader is an object that is responsible for loading classes.
- Process : Process provides control of native processes started by ProcessBuilder.start and Runtime.exec.
- ProcessBuilder : ProcessBuilder class is used to create operating system processes.
- Runtime : Every Java application has a single instance of class Runtime that allows the application to interface with the environment in which the application is running.
- SecurityManager : The security manager is a class that allows applications to implement a security policy.
- System : The System class contains several useful class fields and methods.
Errors and Exceptions Classes in Java
Class Throwable encompasses objects that may be thrown by the throw statement. Subclasses of Throwable represent errors and exceptions.
Errors and Exceptions operations classes in Java as follows.
- Throwable : The Throwable class is the superclass of all errors and exceptions in the Java language.
Character Encoding Classes in Java
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.
void Classes in Java
The Void class is a non-instantiable class that holds a reference to a Class object representing the type void.
- Void : The Void class is an uninstantiable placeholder class to hold a reference to the Class object representing the Java keyword void.