Java.lang

Java.lang

The java.lang package in Java is a package that provides the fundamental classes and interfaces that are essential for Java programming. It is automatically imported in every Java program, and it contains several classes and interfaces that are used by Java’s core libraries and other packages.

Some of the important classes in the java.lang package include:

Object: The root class of the Java class hierarchy, from which all other classes inherit.

String: A class that represents a sequence of characters.

Math: A class that provides methods for performing basic mathematical operations, such as trigonometric functions, exponential functions, and logarithms.

System: A class that provides access to system resources, such as the standard input, output, and error streams, as well as system properties and environment variables.

RuntimeException: A class that represents exceptions that can occur during runtime, such as null pointer exceptions and arithmetic exceptions.

Thread: A class that represents a thread of execution in a Java program.

Throwable: A class that represents an exception or error that can be thrown by a Java program. The java.lang package also includes several interfaces, such as Runnable (used for creating threads), Comparable (used for comparing objects), and CharSequence (used for representing a sequence of characters).

Apply for Core Java Developer Certification Now!!

https://www.vskills.in/certification/certified-core-java-developer

Back to Tutorial

Share this post
[social_warfare]
Data and Object Streams
Strings, StringBuffer

Get industry recognized certification – Contact us

keyboard_arrow_up