Managing Your Programming Environment |
To import a specific object in a package, like Applet in the java.applet package, use theimport
statement.To import all objects in a package, for example, the entire java.applet package, use theimport java.applet.Applet;import
statement with the '*' wildcard character.Importing an object, or an entire package of objects makes the definitions and implementations available to the current package. For example, suppose that you're writing a small Applet:import java.applet.*;If you try to compile this applet without importing the java.applet.Applet class, the compiler will issue this fatal error:class MyApplet extends Applet { . . . }MyApplet.java:2: Super class Applet of class MyApplet not found.
Managing Your Programming Environment |