The import command allows you to reference a class in the imported package only by its class name . For instance, the package java.lang.String is the complete package name for the String class. Since java.lang is always imported automatically, we are free to refer to a string without using the package name.
To import all of the classes in a package, use a wildcard:
import java.sql.*; // now you can refer to any class in the java.sql package by // class name only: Statement stmt = con.createStatement(); class myClass { void make }
Top |