Java Programming/Keywords/import

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search

import is a Java keyword.

It declares a Java class to use in the code below the import statement. Once a Java class is declared, then the class name can be used in the code without specifying the package the class belongs to.

Use the '*' character to declare all the classes belonging to the package.

Syntax:

import package.JavaClass;
import package.*;

See also: