Site icon TestingDocs.com

java.lang Package

Overview

In this tutorial, we will learn about java.lang Package. A Java package is a collection of related classes, interfaces, sub-packages, and other object-oriented types that are grouped together.

Note that: The Java language specification also provides a class called

java.lang.Package which provides version information about the implementation of a Java package.

 

java.lang Package

The java.lang Java package is the default package. It provides classes that are fundamental and basic to the design of the Java Programming Language such as String, Math, class wrappers for primitive types and runtime support for threads. There is no need to import this package explicitly into the Java program.

Interfaces

Some interfaces in the package are:

Classes

Some other classes that are provided in the package are as follows:

Object class is the root of the Java class hierarchy. Every class has Object as the superclass. All objects in Java, implement the methods of this class.

Class instances of this class represent the classes at run time during Java program execution.

Class wrappers for primitive data types like:

Useful classes like:

Classes ClassLoader, Process, Runtime, SecurityManager, and System provide system operations. These classes manage the dynamic loading of Java Classes, the Creation of external processes, the enforcement of security policies, etc.

Class Throwable is the superclass of all errors and exceptions in Java programs. JVM can only throw objects of the Throwable class.

Sub Packages

Some of the sub-packages of java.lang Package is as follows:

 

 

Java Tutorials

Java Tutorial on this website:

https://www.testingdocs.com/java-tutorial/

For more information on Java, visit the official website :

https://www.oracle.com/java/

Exit mobile version