The java.lang package provides classes that are fundamental to the design of the Java programming language. This is the most important package of java API. And also the most important class is Object because Object is the parent of all classes.Â Every classes and instances in java is a child of Object.
There are a lot of instances where we wa have to represent a value of primitive data type as if it is an object thus the java.lang package is very helpful in situation like this. 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. The Void class is a non-instantiable class that holds a reference to a Class object representing the type void.
This section is for readers that want to learn the basic java programming. The java.lang package is necessary to learn since it provides the important classes necessary in learning java. Not only that this is to be learn by novice programmer but this package must also be mastered by an expert programmer as the java.lang package is the foundation of a java programming.
Since JDK 1.0
java.lang Package Classes
The following are the classes under the java.lang package. Please master the majority of these classes as these are all helpful.
|Integer||The Integer class wraps the int primitive data type into an object. This class includes helpful methods in converting value from string to Integer.|
|Math||The class Math contains methods for performing basic numeric operations such as the elementary exponential, logarithm, square root, and trigonometric functions.|
|String||Java String class is represented by character strings.|
|StringBuffer||The StringBuffer is a thread safe, mutable sequence of characters. Its much the same as String however StringBuffer can be modified.|
|Double||The Double class wraps a value of the primitive type double in an object. An object of type Double contains a single field whose type is double.|