import

The import keyword is used by Java to make classes available to the current file using an abbreviated name. Any number of import statements may appear in a Java program, but they must appear after the optional package statement at the top of the file, and before the first class or interface definition in the file.

The following examples demonstrate use of the keyword import:

import my.package.*;   // all classes in my.package are imported
import my.package.cool; // only the cool class is imported from my.package