import statement

A statement that makes code from another module or package available by name in the current file.

In more detail

In Python, import math loads a module and from math import sqrt brings one name in directly. In Java, import java.util.List lets code write List instead of the full package name, and classes in java.lang are imported automatically. Importing everything with a wildcard makes it hard to tell where names came from.

Example

import java.util.List;

Related terms

Taught in

References

Certification courses