The Teacher class used one of the following techniques for referring to a class in a different package.

The fully qualified name of the class can be used. For example:

importcom.javaguides.course.Course;

The package can be imported using the import keyword and the wildcard (*). For example:

importcom.javaguides.course.*;

Few more examples are:

importjava.io.File;
importjava.net.*;

Note that many Java programmers use only specific import statements (no '*') to avoid ambiguity when multiple packages contain classes of the same name.

Java static import

Java 5 introduced a new feature — static import — that can be used to import the static members of the imported package or class. You can use the static members of the imported package or class as if you have defined the static member in the current class.