Specifications

Sun Services
Java™ Programming Language
Module 2, slide 20 of 26
Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision F
The import Statement
Basic syntax of the import statement is:
import
<pkg_name>[
.
<sub_pkg_name>]*
.
<class_name>
;
OR
import
<pkg_name>[
.
<sub_pkg_name>]*
.*;
Examples of the statement are:
import java.util.List;
import java.io.*;
import shipping.gui.reportscreens.*;
The import statement does the following:
Precedes all class declarations
Tells the compiler where to find classes