prev next prev next
  Course navigation
 
Lesson 3
Objective
Using packages
Import classes from a package.
   
Public Java classes are always visible if you use their fully qualified name. The import statement, however, makes Java classes available to the current class with the use of a shortened name. Importing a class doesn't make it visible--it just saves you the task of repeatedly typing the fully qualified name.
There are two forms of the import statement:
Using Java Packages
You can import classes either way, I find it more convenient to import all of the classes in a package using the * wildcard.

Please refer to the Java API documentation if you have a question about any of the standard Java classes or packages.
The Java API documentation is available for download at Sun MicroSystems Web site.

Import Keyword - Exercise
Click the Exercise link below to import classes from packages.
Import Keyword - Exercise
  Course navigation