Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
It is common to use other classes from the class you are writing. Using classes in the same package as your current class is allowed by default. However, to use classes in other packages, you must first import the packages or the classes you want to use.
Java provides the keyword import to indicate that you want to use a package or a class from a package. For example, to use the java.io.File class from your code, you must have the following import statement: